diff options
author | nicm <nicm> | 2014-04-16 23:05:38 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-04-16 23:05:38 +0000 |
commit | 5acee1c04ed38afd6a32da4a66e6855ccdc52af3 (patch) | |
tree | fe2891f503a86f532eba2318dd598dc3580b8208 | |
parent | 871b83cbab3a490827760540f2c36fd1edfe1875 (diff) | |
download | rtmux-5acee1c04ed38afd6a32da4a66e6855ccdc52af3.tar.gz rtmux-5acee1c04ed38afd6a32da4a66e6855ccdc52af3.tar.bz2 rtmux-5acee1c04ed38afd6a32da4a66e6855ccdc52af3.zip |
Memory leak in error path and unnecessary assignment, from clang.
-rw-r--r-- | cmd-save-buffer.c | 1 | ||||
-rw-r--r-- | grid.c | 2 | ||||
-rw-r--r-- | procname.c | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c index 6c15fb42..b6ee2e49 100644 --- a/cmd-save-buffer.c +++ b/cmd-save-buffer.c @@ -142,7 +142,6 @@ do_print: return (CMD_RETURN_ERROR); } msg = NULL; - msglen = 0; used = 0; while (used != pb->size) { @@ -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--; } @@ -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) |