summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-02-23 10:05:22 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-02-23 10:49:12 +0100
commita46b69b5903d02e39f3ee5347a6ce6cc439c76b4 (patch)
tree42a481822164f57512060609b14f38e058fcbe44 /src/rest.c
parent3b3405bc2f6fe2f71ce08cd20bd2938f5f75efec (diff)
#990 Fix og_cmd_wol memory leak
Allocated strings using dbi_result_get_string_copy are not being freed after using them. This patch fix this memory leak. Fixes: e4cb91b ("#990 wol: migrate mac and netmask query to ogServer")
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rest.c b/src/rest.c
index a3377bc..9ef1204 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -493,6 +493,12 @@ static int og_cmd_wol(json_t *element, struct og_msg_params *params)
(char *)params->wol_type))
return -1;
+ for (i = 0; i < params->ips_array_len; ++i) {
+ free((void *)params->ips_array[i]);
+ free((void *)params->mac_array[i]);
+ free((void *)params->netmask_array[i]);
+ }
+
return 0;
}