diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/actions.c | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -2,6 +2,7 @@ * src/actions.c: new command, sselect (cmd_sselect): new function. added prototype. + (cmd_set): free 'var' at the appropriate places. * src/events.c (property_notify): pass the root window to receive_command. diff --git a/src/actions.c b/src/actions.c index 821efa9..3278374 100644 --- a/src/actions.c +++ b/src/actions.c @@ -4309,19 +4309,23 @@ cmd_set (int interactive, char *data) if (!strcmp (var, set_vars[i].var)) { result = set_vars[i].set_fn (rest); - free (var); /* If rest is not NULL then result must be NULL. */ if (rest == NULL) { if (interactive) { marked_message_printf (0, 0, " %s: %s ", var, result); + free (var); free (result); return NULL; } else - return result; + { + free (var); + return result; + } } + free (var); free (rest); return NULL; } |