projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4aa3fd7
)
extra checks
author
Felix Fietkau
<nbd@openwrt.org>
Tue, 29 Jan 2008 23:38:53 +0000
(
00:38
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Tue, 29 Jan 2008 23:38:53 +0000
(
00:38
+0100)
file.c
patch
|
blob
|
history
diff --git
a/file.c
b/file.c
index 0e5992c4de7962b940f36f84449e2c0708fd1686..a0fe58bc67f5c06fb37589d15b40d9f3e27b3508 100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-621,7
+621,7
@@
static void uci_parse_history(struct uci_context *ctx, FILE *stream, struct uci_
static void uci_load_history(struct uci_context *ctx, struct uci_package *p)
{
static void uci_load_history(struct uci_context *ctx, struct uci_package *p)
{
- char *filename;
+ char *filename
= NULL
;
FILE *f = NULL;
if (!p->confdir)
FILE *f = NULL;
if (!p->confdir)
@@
-634,6
+634,8
@@
static void uci_load_history(struct uci_context *ctx, struct uci_package *p)
uci_parse_history(ctx, f, p);
UCI_TRAP_RESTORE(ctx);
done:
uci_parse_history(ctx, f, p);
UCI_TRAP_RESTORE(ctx);
done:
+ if (filename)
+ free(filename);
uci_close_stream(f);
ctx->errno = 0;
}
uci_close_stream(f);
ctx->errno = 0;
}
@@
-802,11
+804,7
@@
char **uci_list_configs(struct uci_context *ctx)
size += strlen(p) + 1;
}
size += strlen(p) + 1;
}
- configs = malloc(size);
- if (!configs)
- return NULL;
-
- memset(configs, 0, size);
+ configs = uci_malloc(ctx, size);
buf = (char *) &configs[globbuf.gl_pathc + 1];
for(i = 0; i < globbuf.gl_pathc; i++) {
char *p;
buf = (char *) &configs[globbuf.gl_pathc + 1];
for(i = 0; i < globbuf.gl_pathc; i++) {
char *p;