mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
Fix memory leaks with paste_replace, based on changes from J Raynor.
This commit is contained in:
parent
69b7c496ac
commit
6daf06b1ad
3 changed files with 6 additions and 3 deletions
4
paste.c
4
paste.c
|
|
@ -131,8 +131,10 @@ paste_replace(struct paste_stack *ps, u_int idx, char *data, size_t size)
|
|||
{
|
||||
struct paste_buffer *pb;
|
||||
|
||||
if (size == 0)
|
||||
if (size == 0) {
|
||||
free(data);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (idx >= ARRAY_LENGTH(ps))
|
||||
return (-1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue