diff options
author | Jo-Philipp Wich <jo@mein.io> | 2025-03-16 23:59:33 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2025-03-16 23:59:33 +0100 |
commit | 67a4ad20f17264c7990db965120880fa9383ca20 (patch) | |
tree | 29dcf0f2201f1cb941d579d2b1988b732dc4889c | |
parent | fb1da7157d138adcc4e20d41685aa6ab400bc042 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |