You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2016/09/06 03:36:19 UTC

[trafficserver] branch master updated: TS-4584: Fix MachineList memory bug seen by the clang analyzer.

This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  ccda36a   TS-4584: Fix MachineList memory bug seen by the clang analyzer.
ccda36a is described below

commit ccda36a69709104bc9f9b7b36035e79063bd800a
Author: James Peach <jp...@apache.org>
AuthorDate: Mon Sep 5 20:36:07 2016 -0700

    TS-4584: Fix MachineList memory bug seen by the clang analyzer.
---
 iocore/cluster/ClusterMachine.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/iocore/cluster/ClusterMachine.cc b/iocore/cluster/ClusterMachine.cc
index 637e43d..e48c5a3 100644
--- a/iocore/cluster/ClusterMachine.cc
+++ b/iocore/cluster/ClusterMachine.cc
@@ -266,6 +266,7 @@ read_MachineList(const char *filename, int afd)
     Warning("read machine list failure, open failed");
     return NULL;
   }
+
   if (n >= 0) {
     if (i != n) {
       if (afd == -1) {
@@ -275,9 +276,10 @@ read_MachineList(const char *filename, int afd)
         return (MachineList *)ats_strdup("number of machines does not match length of list\n");
     }
   }
+
   if (afd != -1) {
     return (MachineList *)NULL;
   }
-  l.release();
-  return l;
+
+  return l.release();
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].