Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
{
char **configs = NULL;
char **p;
+ int ret = 1;
if (argc > 2)
return 255;
if ((uci_list_configs(ctx, &configs) != UCI_OK) || !configs) {
cli_perror();
- return 1;
+ goto out;
}
for (p = configs; *p; p++) {
package_cmd(cmd, *p);
}
- return 0;
+ ret = 0;
+out:
+ free(configs);
+ return ret;
}
static int uci_do_add(int argc, char **argv)
goto done;
error:
- e = NULL;
+ free(section);
memset(ptr, 0, sizeof(struct uci_ptr));
UCI_THROW(ctx, UCI_ERR_INVAL);
done: