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 Sat, 10 Jan 2015 00:08:16 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 5747dc19c -> e9650192e


Fix resource leak in error case

Coverity CID# 1254800


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

Branch: refs/heads/master
Commit: e9650192e36c2db0fccb66ebdf256c7dc72c0450
Parents: 5747dc1
Author: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Authored: Sat Jan 10 00:07:43 2015 +0000
Committer: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Committed: Sat Jan 10 00:07:43 2015 +0000

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


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


Mime
View raw message