summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-01-26 09:03:10 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-01-26 09:03:10 +0000
commit57f7c1fd1f4bcc7eadaf1dc9bc19c54df55687a4 (patch)
tree6d7c6272fe84ef64869bcc84acb7e6c2f0685131 /usr.bin
parent8131af9bd6a6469ddac5a5d355f3d33b286fb909 (diff)
Fix memory leak in error path, from Tiago Cunha.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/status.c5
1 files changed, 3 insertions, 2 deletions
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 <nicm@users.sourceforge.net>
@@ -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;