diff options
author | ewolfok <ewolfok@126.com> | 2014-07-08 17:43:58 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-07-26 05:50:50 +0400 |
commit | 22bbcfddd7b2061343b773c3180f318e71b8d6d7 (patch) | |
tree | e9d61f2ea22ec6a44717ee64b695277f9c88d73e /blobmsg.c | |
parent | f3977836afc82ce32c203173bd393789e05a123e (diff) |
blob: improve out-of-memory handling
Signed-off-by: Chen Bin <ewolfok@126.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'blobmsg.c')
-rw-r--r-- | blobmsg.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |