summaryrefslogtreecommitdiffhomepage
path: root/lib/ubus.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-12-07 15:49:29 +0100
committerJo-Philipp Wich <jo@mein.io>2020-12-07 15:55:14 +0100
commitec41d9f23383f1088afcdc6fcde26d179d9b034e (patch)
treee77030210637472121c0e036c93d7548fe6b549b /lib/ubus.c
parentbd4869f54fecb0f08865fd587cc62e300599e5af (diff)
ubus: fix uninitialized pointer return in uc_ubus_call() and uc_ubus_list()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib/ubus.c')
-rw-r--r--lib/ubus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ubus.c b/lib/ubus.c
index 13f5858..a11b014 100644
--- a/lib/ubus.c
+++ b/lib/ubus.c
@@ -204,7 +204,7 @@ uc_ubus_list(struct uc_state *s, uint32_t off, struct json_object *args)
{
struct ubus_connection **c = (struct ubus_connection **)ops->get_type(s->ctx, "ubus.connection");
struct json_object *objname = json_object_array_get_idx(args, 0);
- struct json_object *res;
+ struct json_object *res = NULL;
enum ubus_msg_status rv;
if (!c || !*c || !(*c)->ctx)
@@ -244,7 +244,7 @@ uc_ubus_call(struct uc_state *s, uint32_t off, struct json_object *args)
struct json_object *objname = json_object_array_get_idx(args, 0);
struct json_object *funname = json_object_array_get_idx(args, 1);
struct json_object *funargs = json_object_array_get_idx(args, 2);
- struct json_object *res;
+ struct json_object *res = NULL;
enum ubus_msg_status rv;
uint32_t id;