diff options
author | nicm <nicm> | 2019-04-25 18:18:55 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-04-25 18:18:55 +0000 |
commit | 32a81e197bce3b16113c7603a766773c1a5cdcaf (patch) | |
tree | 64a3819ff876c804c171a01e6444fda3dc7ff465 /cmd-show-options.c | |
parent | 1677bb0deaa0e5c3e962e36ce98076b0db8507f6 (diff) | |
download | rtmux-32a81e197bce3b16113c7603a766773c1a5cdcaf.tar.gz rtmux-32a81e197bce3b16113c7603a766773c1a5cdcaf.tar.bz2 rtmux-32a81e197bce3b16113c7603a766773c1a5cdcaf.zip |
Make options_tostring allocate its result instead of using a stack
buffer (needed for something in the future).
Diffstat (limited to 'cmd-show-options.c')
-rw-r--r-- | cmd-show-options.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c index b8b9a9bd..328e9c03 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -162,8 +162,8 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item, struct options_entry *o, int idx) { struct options_array_item *a; - const char *name, *value; - char *tmp, *escaped; + const char *name; + char *value, *tmp, *escaped; if (idx != -1) { xasprintf(&tmp, "%s[%d]", options_name(o), idx); @@ -191,6 +191,7 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item, free(escaped); } else cmdq_print(item, "%s %s", name, value); + free(value); free(tmp); } |