trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhe...@apache.org
Subject trafficserver git commit: Fix Resource leak in error case
Date Wed, 07 Jan 2015 18:22:37 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master faefdc4f5 -> 821860981


Fix Resource leak in error case

Coverity CID#1254816


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

Branch: refs/heads/master
Commit: 821860981c9362ab53a16e7881d02d60a50becdc
Parents: faefdc4
Author: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Authored: Wed Jan 7 18:21:49 2015 +0000
Committer: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Committed: Wed Jan 7 18:21:49 2015 +0000

----------------------------------------------------------------------
 proxy/http2/HPACK.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82186098/proxy/http2/HPACK.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HPACK.cc b/proxy/http2/HPACK.cc
index f4afd95..e4e3a64 100644
--- a/proxy/http2/HPACK.cc
+++ b/proxy/http2/HPACK.cc
@@ -591,7 +591,10 @@ decode_literal_header_field(MIMEFieldWrapper& header, const uint8_t
*buf_start,
     char *c_name = NULL;
     uint32_t c_name_len = 0;
     len = decode_string(&c_name, c_name_len, p, buf_end);
-    if (len == -1) return -1;
+    if (len == -1) {
+      ats_free(c_name);
+      return -1;
+    }
     p += len;
     header.name_set(c_name, c_name_len);
     ats_free(c_name);


Mime
View raw message