From d2d2df136502f95da8fa749f10a1e534fca7cde2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 26 Jan 2012 09:03:09 +0000 Subject: [PATCH] Fix memory leak in error path, from Tiago Cunha. --- status.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;