projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
blob: improve out-of-memory handling
[project/libubox.git]
/
blobmsg.c
diff --git
a/blobmsg.c
b/blobmsg.c
index a2c2c5db66778b8a2c3e7c07ab64e84e2ed46879..9fe96e44c8509eedd17189e1710f52cacb4271e0 100644
(file)
--- a/
blobmsg.c
+++ b/
blobmsg.c
@@
-220,6
+220,8
@@
blobmsg_open_nested(struct blob_buf *buf, const char *name, bool array)
name = "";
head = blobmsg_new(buf, type, name, 0, &data);
+ if (!head)
+ return NULL;
blob_set_raw_len(buf->head, blob_pad_len(buf->head) - blobmsg_hdrlen(strlen(name)));
buf->head = head;
return (void *)offset;