Skip to content

Commit

Permalink
Merge pull request #174 from i-ky/fix-memory-leaks
Browse files Browse the repository at this point in the history
Fix a couple of memory leaks
  • Loading branch information
jangaraj authored Feb 22, 2022
2 parents f829b78 + 9f59587 commit f4c80ba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/zabbix_module_docker/zabbix_module_docker.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ int zbx_module_docker_port_discovery(AGENT_REQUEST * request, AGENT_RESULT * res
iresult = zbx_module_docker_inspect_exec(container, "HostConfig", "PortBindings", NULL);
if (iresult.return_code == SYSINFO_RET_FAIL) {
zabbix_log(LOG_LEVEL_DEBUG, "zbx_module_docker_inspect_exec FAIL: %s", iresult.value);
free(iresult.value);
return SYSINFO_RET_FAIL;
}

Expand Down Expand Up @@ -1776,6 +1777,7 @@ int zbx_module_docker_discovery_extended(AGENT_REQUEST *request, AGENT_RESUL
json_object_set_new(o, "{#HCONTAINERID}", json_string(names));
} else {
zabbix_log(LOG_LEVEL_DEBUG, "Default HCONTAINERID is used, because zbx_module_docker_inspect_exec FAIL: %s", iresult.value);
free(iresult.value);
json_object_set_new(o, "{#HCONTAINERID}", json_string(names));
}
} else {
Expand Down

0 comments on commit f4c80ba

Please sign in to comment.