hostapd: fix ucode memory leak with strings
authorMatthew Cather <mattbob4@gmail.com>
Mon, 3 Mar 2025 19:22:11 +0000 (13:22 -0600)
committerFelix Fietkau <nbd@nbd.name>
Wed, 5 Mar 2025 07:03:00 +0000 (08:03 +0100)
commitf79968ee0f76c41414fb0c08980b9c2a259964d3
tree87299083351bdb43ce2fa138b0fd5c90167e88ff
parent90dee1ab30809ee415a8f18965ec2193d438195c
hostapd: fix ucode memory leak with strings

This fixes a common reference counting bug typically along the lines of:
```
uc_value_push(ucv_get(ucv_string_new(...)));
```
This would leave our new string with a reference count of 2, one from
the construction of the string, the other from `ucv_get`. This would
prevent the strings from being correctly cleaned up when it goes out
of scope.

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