From c846298747b6167a34b38d01899a28dd3d840889 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Sun, 29 Jan 2012 12:51:43 +0000 Subject: [PATCH] Sync OpenBSD patchset 1012: 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 8e065ce8..96fa05ee 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;