diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 74e5558626d..a865a292e13 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -916,7 +916,7 @@ void hostapd_ucode_free(void) void hostapd_ucode_free_iface(struct hostapd_iface *iface) { - wpa_ucode_registry_remove(iface_registry, iface->ucode.idx); + ucv_put(wpa_ucode_registry_remove(iface_registry, iface->ucode.idx)); } void hostapd_ucode_bss_cb(struct hostapd_data *hapd, const char *type) @@ -950,6 +950,8 @@ void hostapd_ucode_free_bss(struct hostapd_data *hapd) uc_value_push(ucv_string_new(hapd->conf->iface)); uc_value_push(ucv_get(val)); ucv_put(wpa_ucode_call(2)); + + ucv_put(val); ucv_gc(vm); } diff --git a/package/network/services/hostapd/src/src/utils/ucode.c b/package/network/services/hostapd/src/src/utils/ucode.c index c5b7e39a0ef..a7cc2c7059c 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -471,6 +471,7 @@ uc_value_t *wpa_ucode_registry_remove(uc_value_t *reg, int idx) if (!val) return NULL; + ucv_get(val); ucv_array_set(reg, idx - 1, NULL); dataptr = ucv_resource_dataptr(val, NULL); if (dataptr) diff --git a/package/network/services/hostapd/src/wpa_supplicant/ucode.c b/package/network/services/hostapd/src/wpa_supplicant/ucode.c index 506bde45c93..8335a27e892 100644 --- a/package/network/services/hostapd/src/wpa_supplicant/ucode.c +++ b/package/network/services/hostapd/src/wpa_supplicant/ucode.c @@ -70,6 +70,7 @@ void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s) uc_value_push(ucv_string_new(wpa_s->ifname)); uc_value_push(ucv_get(val)); ucv_put(wpa_ucode_call(2)); + ucv_put(val); ucv_gc(vm); }