From: nicm Date: Wed, 16 Apr 2014 23:05:38 +0000 (+0000) Subject: Memory leak in error path and unnecessary assignment, from clang. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=97bb737e7a5183b78765d7456a0e370d876bf7a3;p=openbsd Memory leak in error path and unnecessary assignment, from clang. --- diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c index 20755780b34..1e9b11825a2 100644 --- a/usr.bin/tmux/cmd-save-buffer.c +++ b/usr.bin/tmux/cmd-save-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-save-buffer.c,v 1.22 2014/04/07 10:32:16 nicm Exp $ */ +/* $OpenBSD: cmd-save-buffer.c,v 1.23 2014/04/16 23:05:38 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -142,7 +142,6 @@ do_print: return (CMD_RETURN_ERROR); } msg = NULL; - msglen = 0; used = 0; while (used != pb->size) { diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 6c00ca0f3ed..4b3de5c38d0 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.36 2014/03/31 21:42:27 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.37 2014/04/16 23:05:38 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -624,7 +624,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, off += size; } - if (trim) { + if (trim) { while (off > 0 && buf[off - 1] == ' ') off--; } diff --git a/usr.bin/tmux/procname.c b/usr.bin/tmux/procname.c index b3acfd0ebfa..4fb96038fe2 100644 --- a/usr.bin/tmux/procname.c +++ b/usr.bin/tmux/procname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procname.c,v 1.11 2013/10/10 12:39:24 nicm Exp $ */ +/* $OpenBSD: procname.c,v 1.12 2014/04/16 23:05:38 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -96,7 +96,7 @@ get_proc_name(int fd, char *tty) retry: if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1) - return (NULL); + goto error; len = (len * 5) / 4; if ((newbuf = realloc(buf, len)) == NULL)