return 0;
for (j = 0; j < i; j++) {
- if (argv[j])
- free(argv[j]);
+ free(argv[j]);
}
return ret;
UCI_THROW(ctx, UCI_ERR_IO);
}
}
- if (filename)
- free(filename);
+ free(filename);
uci_close_stream(f);
ctx->err = 0;
return changes;
UCI_TRAP_RESTORE(ctx);
done:
- if (filename)
- free(filename);
+ free(filename);
uci_close_stream(pctx->file);
uci_foreach_element_safe(&list, tmp, e) {
uci_free_element(e);
ctx->err = 0;
error:
- if (package)
- free(package);
- if (section)
- free(section);
- if (option)
- free(option);
+ free(package);
+ free(section);
+ free(option);
if (ctx->err)
UCI_THROW(ctx, ctx->err);
return 0;
done:
uci_close_stream(f);
- if (filename)
- free(filename);
+ free(filename);
if (ctx->err)
UCI_THROW(ctx, ctx->err);
UCI_TRAP_RESTORE(ctx);
done:
- if (name)
- free(name);
- if (path)
- free(path);
+ free(name);
+ free(path);
uci_close_stream(f1);
if (do_rename && rename(filename, p->path)) {
unlink(filename);
__private void
uci_free_element(struct uci_element *e)
{
- if (e->name)
- free(e->name);
+ free(e->name);
if (!uci_list_empty(&e->list))
uci_list_del(&e->list);
free(e);
if(!p)
return;
- if (p->path)
- free(p->path);
+ free(p->path);
uci_foreach_element_safe(&p->sections, tmp, e) {
uci_free_section(uci_to_section(e));
}
uci_add_delta(ctx, &p->delta, UCI_CMD_RENAME, ptr->section, ptr->option, ptr->value);
n = uci_strdup(ctx, ptr->value);
- if (e->name)
- free(e->name);
+ free(e->name);
e->name = n;
if (e->type == UCI_TYPE_SECTION)
return 0;
error_mem:
- if (sd->alloc_custom)
- free(sd->alloc_custom);
- if (sd->allocmap)
- free(sd->allocmap);
+ free(sd->alloc_custom);
+ free(sd->allocmap);
free(sd);
return UCI_ERR_MEM;