trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [7/7] trafficserver git commit: Fix record list termination memory leak.
Date Fri, 02 Jan 2015 21:09:01 GMT
Fix record list termination memory leak.

Coverity CID #1237319


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7d11e005
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7d11e005
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7d11e005

Branch: refs/heads/master
Commit: 7d11e005d002dbe9f4f6e6a5a01be37f4d516fc6
Parents: eba452d
Author: James Peach <jpeach@apache.org>
Authored: Mon Dec 29 22:13:29 2014 -0800
Committer: James Peach <jpeach@apache.org>
Committed: Fri Jan 2 12:45:52 2015 -0800

----------------------------------------------------------------------
 mgmt/api/CoreAPIRemote.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7d11e005/mgmt/api/CoreAPIRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPIRemote.cc b/mgmt/api/CoreAPIRemote.cc
index 11b647b..67de06f 100644
--- a/mgmt/api/CoreAPIRemote.cc
+++ b/mgmt/api/CoreAPIRemote.cc
@@ -575,11 +575,13 @@ MgmtRecordGetMatching(const char * regex, TSList rec_vals)
     // parse the reply to get record value and type
     ret = mgmt_record_get_reply(RECORD_MATCH_GET, rec_ele);
     if (ret != TS_ERR_OKAY) {
+      TSRecordEleDestroy(rec_ele);
       goto fail;
     }
 
     // A NULL record ends the list.
     if (rec_ele->rec_type == TS_REC_UNDEFINED) {
+      TSRecordEleDestroy(rec_ele);
       break;
     }
 
@@ -590,7 +592,6 @@ MgmtRecordGetMatching(const char * regex, TSList rec_vals)
 
 fail:
 
-  TSRecordEleDestroy(rec_ele);
   for (rec_ele = (TSRecordEle *) dequeue((LLQ *) rec_vals); rec_ele; rec_ele = (TSRecordEle
*) dequeue((LLQ *) rec_vals)) {
       TSRecordEleDestroy(rec_ele);
   }


Mime
View raw message