diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-01-26 09:03:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-01-26 09:03:09 +0000 |
commit | d2d2df136502f95da8fa749f10a1e534fca7cde2 (patch) | |
tree | bc86f9dd9559e8eb5cb4c5af9bbaadf9c367f90e | |
parent | 678e67437f8549404a60809403d179d84c12a7da (diff) |
Fix memory leak in error path, from Tiago Cunha.
-rw-r--r-- | status.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |