[ZBX-9403] memory leak in function "get_host_availability_data" Created: 2015 Mar 15 Updated: 2017 May 30 Resolved: 2015 Mar 16 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 2.5.0 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | cheliequan | Assignee: | Unassigned |
Resolution: | Won't fix | Votes: | 0 |
Labels: | memoryleak | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
CentOS 6.5 x64 |
Attachments: |
![]() ![]() |
Description |
the zbx_host_availability_t struct no free in the function "get_host_availability_data". |
Comments |
Comment by cheliequan [ 2015 Mar 15 ] |
memory leak in function "get_host_availability_data" |
Comment by Aleksandrs Saveljevs [ 2015 Mar 16 ] |
Array "ha" is a static array, which keeps its value between function invocations and is declared as follows: static zbx_host_availability_t *ha = NULL; static int ha_alloc = 0, ha_num = 0; Error messages are strdup()-ed using ZBX_STRDUP(), which frees the old string before allocating a new one. There is no need to free the "ha" array and its contents upon function exit - it will be reused in the next function call. |