mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Fix memleak from not freed uci_list_configs pointers
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This commit is contained in:
parent
95e1f34a7f
commit
033380161d
1 changed files with 7 additions and 4 deletions
|
|
@ -331,6 +331,7 @@ int dmuci_commit(void)
|
|||
char **configs = NULL;
|
||||
char **bbfdm_configs = NULL;
|
||||
char **p;
|
||||
int rc = 0;
|
||||
|
||||
if ((uci_list_configs(uci_ctx, &configs) != UCI_OK) || !configs) {
|
||||
return -1;
|
||||
|
|
@ -338,18 +339,19 @@ int dmuci_commit(void)
|
|||
for (p = configs; *p; p++) {
|
||||
dmuci_commit_package(*p);
|
||||
}
|
||||
if(uci_ctx_bbfdm)
|
||||
{
|
||||
if(uci_ctx_bbfdm) {
|
||||
if ((uci_list_configs(uci_ctx_bbfdm, &bbfdm_configs) != UCI_OK) || !bbfdm_configs) {
|
||||
return -1;
|
||||
rc = -1;
|
||||
goto out;
|
||||
}
|
||||
for (p = bbfdm_configs; *p; p++) {
|
||||
DMUCI_COMMIT_PACKAGE(bbfdm, *p);
|
||||
}
|
||||
}
|
||||
out:
|
||||
free(configs);
|
||||
free(bbfdm_configs);
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**** UCI REVERT *****/
|
||||
|
|
@ -378,6 +380,7 @@ int dmuci_revert(void)
|
|||
for (p = configs; *p; p++) {
|
||||
dmuci_revert_package(*p);
|
||||
}
|
||||
free(configs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue