mirror of
https://github.com/tmux/tmux.git
synced 2025-09-06 08:57:06 +00:00
Sync OpenBSD patchset 1012:
Fix memory leak in error path, from Tiago Cunha.
This commit is contained in:
3
status.c
3
status.c
@ -462,12 +462,13 @@ do_replace:
|
|||||||
ptrlen = limit;
|
ptrlen = limit;
|
||||||
|
|
||||||
if (*optr + ptrlen >= out + outsize - 1)
|
if (*optr + ptrlen >= out + outsize - 1)
|
||||||
return;
|
goto out;
|
||||||
while (ptrlen > 0 && *ptr != '\0') {
|
while (ptrlen > 0 && *ptr != '\0') {
|
||||||
*(*optr)++ = *ptr++;
|
*(*optr)++ = *ptr++;
|
||||||
ptrlen--;
|
ptrlen--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
if (freeptr != NULL)
|
if (freeptr != NULL)
|
||||||
xfree(freeptr);
|
xfree(freeptr);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user