diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-12 21:02:27 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-12 21:02:27 +0100 |
commit | 699d9d2facd377c72c962e1f029f654530e8bba8 (patch) | |
tree | c5a71356eafec8f137ae30977e93f4d406cc80a4 /options.c | |
parent | 42da951edfc1fadee0e9e7f08deedb24ffe482b8 (diff) | |
parent | c3c3927c2bf90f10623374edb579eb19fb192ab7 (diff) | |
download | rtmux-699d9d2facd377c72c962e1f029f654530e8bba8.tar.gz rtmux-699d9d2facd377c72c962e1f029f654530e8bba8.tar.bz2 rtmux-699d9d2facd377c72c962e1f029f654530e8bba8.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -354,16 +354,23 @@ options_array_set(struct options_entry *o, u_int idx, const char *value, struct options_array_item *a; char *new; struct cmd_list *cmdlist; + char *error; if (!OPTIONS_IS_ARRAY(o)) { - *cause = xstrdup("not an array"); + if (cause != NULL) + *cause = xstrdup("not an array"); return (-1); } if (OPTIONS_IS_COMMAND(o)) { - cmdlist = cmd_string_parse(value, NULL, 0, cause); - if (cmdlist == NULL && *cause != NULL) + cmdlist = cmd_string_parse(value, NULL, 0, &error); + if (cmdlist == NULL && error != NULL) { + if (cause != NULL) + *cause = error; + else + free(error); return (-1); + } } a = options_array_item(o, idx); |