hostapd: consistent reference counting for registry
authorMatthew Cather <mattbob4@gmail.com>
Mon, 3 Mar 2025 20:00:35 +0000 (14:00 -0600)
committerFelix Fietkau <nbd@nbd.name>
Wed, 5 Mar 2025 07:03:00 +0000 (08:03 +0100)
commit7729f960933a03c9eebd2b65a695ea57718ccb77
tree5278da94987ff3198624f4ff0123f63afd8fac29
parent22eaf1864731dd29918357b26565dbd9420fd314
hostapd: consistent reference counting for registry

Since `wpa_ucode_registry_add` collects its own reference to the values added, the
two functions `hostapd_ucode_bss_get_uval` and `hostapd_ucode_iface_get_uval` would
sometimes return a referenced object (from `uc_resource_new`) and sometimes return
an unreferenced object (from `wpa_ucode_registry_get`). Now, both functions always
return a referenced object.

This change also indirectly fixes `hostapd_ucode_bss_get_uval`, ensuring it now
always returns a referenced object.

Signed-off-by: Matthew Cather <mattbob4@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/src/ap/ucode.c
package/network/services/hostapd/src/wpa_supplicant/ucode.c