ubus: fix shadow local variable
authorÁlvaro Fernández Rojas <[email protected]>
Fri, 28 Nov 2025 11:46:38 +0000 (12:46 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Fri, 28 Nov 2025 11:50:03 +0000 (12:50 +0100)
Fix leftover shadowed local variable in ubus code from commit a170d63874f2.

src/ubus.c:130:38: error: declaration of 'a' shadows a previous local [-Werror=shadow=local]
  130 |                 struct dhcpv6_lease *a, *border;
      |                                      ^
src/ubus.c:118:15: note: shadowed declaration is here
  118 |         void *a;
      |               ^

Fixes: a170d63874f2 ("src: fix shadowed local variables")
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/ubus.c

index 426c1a26c24e31f8e21db042b4be216a2bf6c7e3..5b6cf223f37a44be3535adad5367bed484a6dcdc 100644 (file)
@@ -115,10 +115,10 @@ static int handle_dhcpv6_leases(_o_unused struct ubus_context *ctx, _o_unused st
 {
        struct interface *iface;
        time_t now = odhcpd_time();
-       void *a;
+       void *dev_tbl;
 
        blob_buf_init(&b, 0);
-       a = blobmsg_open_table(&b, "device");
+       dev_tbl = blobmsg_open_table(&b, "device");
 
        avl_for_each_element(&interfaces, iface, avl) {
                if (iface->dhcpv6 != MODE_SERVER)
@@ -172,8 +172,9 @@ static int handle_dhcpv6_leases(_o_unused struct ubus_context *ctx, _o_unused st
                blobmsg_close_table(&b, i);
        }
 
-       blobmsg_close_table(&b, a);
+       blobmsg_close_table(&b, dev_tbl);
        ubus_send_reply(ctx, req, b.head);
+
        return 0;
 }