mirror of
https://github.com/tmate-io/tmate.git
synced 2026-07-22 02:35:39 +00:00
Fix memory leak in error path, from Tiago Cunha.
This commit is contained in:
parent
678e67437f
commit
d2d2df1365
1 changed files with 2 additions and 1 deletions
3
status.c
3
status.c
|
|
@ -462,12 +462,13 @@ do_replace:
|
|||
ptrlen = limit;
|
||||
|
||||
if (*optr + ptrlen >= out + outsize - 1)
|
||||
return;
|
||||
goto out;
|
||||
while (ptrlen > 0 && *ptr != '\0') {
|
||||
*(*optr)++ = *ptr++;
|
||||
ptrlen--;
|
||||
}
|
||||
|
||||
out:
|
||||
if (freeptr != NULL)
|
||||
xfree(freeptr);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue