]> git.ipfire.org Git - thirdparty/openwrt.git/commit
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:04:52 +0000 (08:04 +0100)
commitb7ab34d46ca354ed002c192c84aef5fa8fb53ed7
tree16b200b8158dd01fddfec765cccefeb1d960b6b3
parent9836836302afa6a7687e6b19c7780be8d16e8911
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>
(cherry picked from commit f79968ee0f76c41414fb0c08980b9c2a259964d3)
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