[ZBX-8948] Memory leak when checking action condition "Template" = <template name> Created: 2014 Oct 24 Updated: 2017 May 30 Resolved: 2014 Oct 25 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 2.0.13, 2.2.6, 2.4.1, 2.5.0 |
Fix Version/s: | 2.0.14rc1, 2.2.8rc1, 2.4.2rc1, 2.5.0 |
Type: | Incident report | Priority: | Blocker |
Reporter: | Andris Zeila | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | memoryleak | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Description |
In the following code at src/zabbix_server/actions.c:116 do { result = DBselect( "select distinct i.hostid,t.templateid" " from items i,functions f,triggers t" " where i.itemid=f.itemid" " and f.triggerid=t.templateid" " and t.triggerid=" ZBX_FS_UI64, triggerid); if (NULL != (row = DBfetch(result))) { ZBX_STR2UINT64(hostid, row[0]); ZBX_STR2UINT64(triggerid, row[1]); if (hostid == condition_value) { ret = SUCCEED; break; } } else triggerid = 0; DBfree_result(result); } while (SUCCEED != ret && 0 != triggerid); the result variable might not be freed with DBfree_result(). A patch to fix it: Index: src/zabbix_server/actions.c =================================================================== --- src/zabbix_server/actions.c (revision 50119) +++ src/zabbix_server/actions.c (working copy) @@ -129,10 +129,7 @@ ZBX_STR2UINT64(triggerid, row[1]); if (hostid == condition_value) - { ret = SUCCEED; - break; - } } else triggerid = 0; |
Comments |
Comment by Andris Zeila [ 2014 Oct 24 ] |
This might be the reason for DB2 handle leak in |
Comment by Andris Zeila [ 2014 Oct 24 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-8948 |
Comment by Andris Zeila [ 2014 Oct 24 ] |
Releaed in:
|
Comment by richlv [ 2014 Oct 25 ] |
(1) this change went in both 2.4 and trunk. the changelog entry is present for 2.5.0 - i believe it should not be sasha Thanks! Removed directly from trunk in r50187. CLOSED |
Comment by Alexander Vladishev [ 2014 Oct 25 ] |
This memory leak can be in "History syncer" and "Timer" processes on server side when processing of action conditions "Template = <template name>". |