summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index bee5e24..a3377bc 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -2924,7 +2924,7 @@ void og_schedule_run(unsigned int task_id, unsigned int schedule_id,
}
if (!duplicated)
- params.ips_array[params.ips_array_len++] = cmd->ip;
+ params.ips_array[params.ips_array_len++] = strdup(cmd->ip);
else
duplicated = false;
}
@@ -2945,6 +2945,9 @@ void og_schedule_run(unsigned int task_id, unsigned int schedule_id,
}
og_send_request(OG_METHOD_GET, OG_CMD_RUN_SCHEDULE, &params, NULL);
+
+ for (i = 0; i < params.ips_array_len; i++)
+ free((void *)params.ips_array[i]);
}
static int og_cmd_task_post(json_t *element, struct og_msg_params *params)