From f317a0fdfe3be41554901a8f83af907f7927c599 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 23 Apr 2023 20:10:43 +0100 Subject: [PATCH] Fix incorrect free --- plugins/dynamic-security/clients.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/dynamic-security/clients.c b/plugins/dynamic-security/clients.c index 9fab903a..ecc9b35c 100644 --- a/plugins/dynamic-security/clients.c +++ b/plugins/dynamic-security/clients.c @@ -107,7 +107,7 @@ void dynsec_clients__cleanup(struct dynsec__data *data) int dynsec_clients__config_load(struct dynsec__data *data, cJSON *tree) { - cJSON *j_clients, *j_client, *jtmp, *j_roles, *j_role; + cJSON *j_clients, *j_client = NULL, *jtmp, *j_roles, *j_role; struct dynsec__client *client; struct dynsec__role *role; unsigned char *buf; @@ -127,7 +127,6 @@ int dynsec_clients__config_load(struct dynsec__data *data, cJSON *tree) if(cJSON_IsArray(j_clients) == false){ return 1; } - cJSON_ArrayForEach(j_client, j_clients){ if(cJSON_IsObject(j_client) == true){ /* Username */ @@ -168,7 +167,6 @@ int dynsec_clients__config_load(struct dynsec__data *data, cJSON *tree) } memcpy(client->pw.salt, buf, (size_t)buf_len); client->pw.salt_len = (size_t)buf_len; - mosquitto_free(buf); if(base64__decode(password, &buf, &buf_len) != MOSQ_ERR_SUCCESS || buf_len != sizeof(client->pw.password_hash)){