diff options
author | brl <brl> | 2007-05-17 14:16:06 +0000 |
---|---|---|
committer | brl <brl> | 2007-05-17 14:16:06 +0000 |
commit | 2d60835a3e8ba8af87f0b61e5ceb022f4ef37003 (patch) | |
tree | 4e03181e5635bb4eabd901f27de524e0c6e2f6a3 | |
parent | a42464993f766c4463c8aae27e60b566002fb67c (diff) | |
download | ratpoison-2d60835a3e8ba8af87f0b61e5ceb022f4ef37003.zip |
* src/actions.c (cmd_windows): free buffer to close memory hole
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/actions.c | 10 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,7 @@ +2007-05-17 Bernhard R. Link <brlink@debian.org> + + * src/actions.c (cmd_windows): free buffer to close memory hole + 2007-05-07 Shawn Betts <sabetts@shitbender.gagrod> * src/main.c (init_defaults): only load the backup font when the diff --git a/src/actions.c b/src/actions.c index dd325c6..c1c8b4f 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2649,7 +2649,6 @@ cmdret * cmd_windows (int interactive, struct cmdarg **args) { struct sbuf *window_list = NULL; - char *tmp; int dummy; rp_screen *s; char *fmt; @@ -2674,12 +2673,13 @@ cmd_windows (int interactive, struct cmdarg **args) } else { + cmdret *ret; + window_list = sbuf_new (0); get_window_list (fmt, "\n", window_list, &dummy, &dummy); - tmp = sbuf_get (window_list); - free (window_list); - - return cmdret_new (RET_SUCCESS, "%s", tmp); + ret = cmdret_new (RET_SUCCESS, "%s", sbuf_get (window_list)); + sbuf_free (window_list); + return ret; } } |