You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2015/07/09 19:02:45 UTC

trafficserver git commit: TS-3747: Error in Huffman decoder for HPACK Added free and code cleanup for unit test

Repository: trafficserver
Updated Branches:
  refs/heads/master 53282ff4a -> 549f26680


TS-3747: Error in Huffman decoder for HPACK
Added free and code cleanup for unit test


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

Branch: refs/heads/master
Commit: 549f26680eaf5c8c9a30e9ea44620e5d83257a90
Parents: 53282ff
Author: Bryan Call <bc...@apache.org>
Authored: Thu Jul 9 10:01:26 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Jul 9 10:02:31 2015 -0700

----------------------------------------------------------------------
 proxy/http2/test_Huffmancode.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/549f2668/proxy/http2/test_Huffmancode.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/test_Huffmancode.cc b/proxy/http2/test_Huffmancode.cc
index 6a3498d..e7a973f 100644
--- a/proxy/http2/test_Huffmancode.cc
+++ b/proxy/http2/test_Huffmancode.cc
@@ -7,9 +7,10 @@ using namespace std;
 void
 test()
 {
-  char *dst_start = (char *)malloc(1024 * 2);
-  char string[1024];
-  for (int i = 0; i < 1024; i++) {
+  const int size = 1024;
+  char *dst_start = (char *)malloc(size * 2);
+  char string[size];
+  for (int i = 0; i < size; i++) {
     long num = lrand48();
     string[i] = (char)num;
   }
@@ -22,6 +23,8 @@ test()
   for (int i = 0; i < bytes; i++) {
     cout << i << " " << (int)dst_start[i] << " " << dst_start[i] << endl;
   }
+
+  free(dst_start);
 }
 
 int