X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=blobmsg.c;h=80b984a133cd52f0d3a5fefe33de4e9739d99e71;hp=a2c2c5db66778b8a2c3e7c07ab64e84e2ed46879;hb=5326ce1046425154ab715387949728cfb09f4083;hpb=7ba1f8acd8afb451a05276eda5d3567a53ef2fb3 diff --git a/blobmsg.c b/blobmsg.c index a2c2c5d..80b984a 100644 --- 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; @@ -260,7 +262,6 @@ blobmsg_alloc_string_buffer(struct blob_buf *buf, const char *name, unsigned int if (!attr) return NULL; - data_dest = blobmsg_data(attr); blob_set_raw_len(buf->head, blob_pad_len(buf->head) - blob_pad_len(attr)); blob_set_raw_len(attr, blob_raw_len(attr) - maxlen);