From 57f7c1fd1f4bcc7eadaf1dc9bc19c54df55687a4 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 26 Jan 2012 09:03:10 +0000 Subject: Fix memory leak in error path, from Tiago Cunha. --- usr.bin/tmux/status.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 6bb6948a890..19f65e42163 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.84 2012/01/20 19:51:28 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.85 2012/01/26 09:03:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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; -- cgit v1.2.3