projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add a few missing null pointer checks, and fix check vs dereference order in some...
[project/uci.git]
/
ucimap.c
diff --git
a/ucimap.c
b/ucimap.c
index 6a5c11721bbc79e192d22785e8ce1c7997bdc342..0bc31c58601dbee9bbbfdc75dde2dc65c70b8fea 100644
(file)
--- a/
ucimap.c
+++ b/
ucimap.c
@@
-295,6
+295,9
@@
realloc:
offset = (items - (*list)->size) * sizeof(union ucimap_data);
a->ptr = realloc(a->ptr, size);
+ if (!a->ptr)
+ return -ENOMEM;
+
if (offset)
memset((char *) a->ptr + offset, 0, size - offset);
new = a->ptr;