projects
/
oweals
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f85abaa
)
add missing null pointer check after malloc
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 30 Aug 2009 01:12:49 +0000
(
03:12
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 30 Aug 2009 01:12:49 +0000
(
03:12
+0200)
libuci.c
patch
|
blob
|
history
diff --git
a/libuci.c
b/libuci.c
index a3dde2edc4adedd320577cc138a26472c586bcb2..a1fd92a1277713da3449bfb65e2bb84b1fdc57cc 100644
(file)
--- a/
libuci.c
+++ b/
libuci.c
@@
-55,6
+55,9
@@
struct uci_context *uci_alloc_context(void)
struct uci_context *ctx;
ctx = (struct uci_context *) malloc(sizeof(struct uci_context));
+ if (!ctx)
+ return NULL;
+
memset(ctx, 0, sizeof(struct uci_context));
uci_list_init(&ctx->root);
uci_list_init(&ctx->history_path);