summaryrefslogtreecommitdiffstats
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-01-26 09:03:09 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-01-26 09:03:09 +0000
commitd2d2df136502f95da8fa749f10a1e534fca7cde2 (patch)
treebc86f9dd9559e8eb5cb4c5af9bbaadf9c367f90e /status.c
parent678e67437f8549404a60809403d179d84c12a7da (diff)
Fix memory leak in error path, from Tiago Cunha.
Diffstat (limited to 'status.c')
-rw-r--r--status.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/status.c b/status.c
index 2fb89d1f..c111a238 100644
--- a/status.c
+++ b/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;