Message ID | 1435270908-24195-1-git-send-email-jch@pps.univ-paris-diderot.fr |
---|---|
State | Changes Requested |
Headers | show |
On 2015-06-26 00:21, Juliusz Chroboczek wrote: > --- > libubus.c | 3 +++ > ubusd_acl.c | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/libubus.c b/libubus.c > index ccaa069..9aae613 100644 > --- a/libubus.c > +++ b/libubus.c > @@ -77,6 +77,9 @@ ubus_queue_msg(struct ubus_context *ctx, struct ubus_msghdr_buf *buf) > void *data; > > pending = calloc_a(sizeof(*pending), &data, blob_raw_len(buf->data)); > + if (!pending) > + /* XXX */ > + return; Please use tab instead of space for indenting. Also, why XXX here? - Felix
diff --git a/libubus.c b/libubus.c index ccaa069..9aae613 100644 --- a/libubus.c +++ b/libubus.c @@ -77,6 +77,9 @@ ubus_queue_msg(struct ubus_context *ctx, struct ubus_msghdr_buf *buf) void *data; pending = calloc_a(sizeof(*pending), &data, blob_raw_len(buf->data)); + if (!pending) + /* XXX */ + return; pending->hdr.data = data; memcpy(&pending->hdr.hdr, &buf->hdr, sizeof(buf->hdr)); diff --git a/ubusd_acl.c b/ubusd_acl.c index 3c16114..5ed7b99 100644 --- a/ubusd_acl.c +++ b/ubusd_acl.c @@ -207,6 +207,8 @@ ubusd_acl_alloc_obj(struct ubusd_acl_file *file, const char *obj) char *k; o = calloc_a(1, sizeof(*o), &k, strlen(obj) + 1); + if (!o) + return NULL; o->user = file->user; o->group = file->group; o->avl.key = k;