summaryrefslogtreecommitdiffhomepage
path: root/ubus.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-02-01 10:56:17 +0100
committerFelix Fietkau <nbd@openwrt.org>2016-02-01 11:09:57 +0100
commit1eac490bd39bcf8b48795fe0555b4451ba2bf1dd (patch)
tree9c8069c72decffffdd4ced1194e7ca8bcd3961bf /ubus.c
parent11797342f8ab344850893a3857210d1cd0fbd285 (diff)
ubus: Fix possible segfault
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ubus.c b/ubus.c
index 454b42d..4184301 100644
--- a/ubus.c
+++ b/ubus.c
@@ -969,6 +969,9 @@ static void netifd_add_iface_object(void)
int i;
methods = calloc(1, sizeof(iface_object_methods));
+ if (!methods)
+ return;
+
memcpy(methods, iface_object_methods, sizeof(iface_object_methods));
iface_object.methods = methods;