summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2025-03-16 23:59:33 +0100
committerJo-Philipp Wich <jo@mein.io>2025-03-16 23:59:33 +0100
commit67a4ad20f17264c7990db965120880fa9383ca20 (patch)
tree29dcf0f2201f1cb941d579d2b1988b732dc4889c
parentfb1da7157d138adcc4e20d41685aa6ab400bc042 (diff)
ubus: fix uninitialized variable warning
Explicitly zero-initialize `obi` in `_args_get()` to avoid the following compiler warning: .../ubus.c: In function ‘_args_get’: .../ubus.c:100:31: error: ‘obj’ may be used uninitialized [-Werror=maybe-uninitialized] 100 | arg = ucv_object_get(obj, name, NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--lib/ubus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ubus.c b/lib/ubus.c
index a2eb57e..299b112 100644
--- a/lib/ubus.c
+++ b/lib/ubus.c
@@ -70,7 +70,7 @@ _arg_type(uc_type_t type)
static bool
_args_get(uc_vm_t *vm, bool named, size_t nargs, ...)
{
- uc_value_t **ptr, *arg, *obj;
+ uc_value_t **ptr, *arg, *obj = NULL;
uc_type_t type, t;
const char *name;
size_t index = 0;