mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-06 14:14:33 +02:00
local-ctrl: fix memory allocation issues found by static analyser
This commit is contained in:
@@ -214,7 +214,7 @@ static void esp_local_ctrl_command_cleanup(LocalCtrlMessage *resp, void **ctx)
|
|||||||
if (resp->resp_get_prop_vals) {
|
if (resp->resp_get_prop_vals) {
|
||||||
prop_val_free_fn_t *free_fns = (prop_val_free_fn_t *)(*ctx);
|
prop_val_free_fn_t *free_fns = (prop_val_free_fn_t *)(*ctx);
|
||||||
for (size_t i = 0; i < resp->resp_get_prop_vals->n_props; i++) {
|
for (size_t i = 0; i < resp->resp_get_prop_vals->n_props; i++) {
|
||||||
if (free_fns[i]) {
|
if (free_fns && free_fns[i]) {
|
||||||
free_fns[i](resp->resp_get_prop_vals->props[i]->value.data);
|
free_fns[i](resp->resp_get_prop_vals->props[i]->value.data);
|
||||||
}
|
}
|
||||||
free(resp->resp_get_prop_vals->props[i]);
|
free(resp->resp_get_prop_vals->props[i]);
|
||||||
|
Reference in New Issue
Block a user