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

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 5199be1  Fixed memory leak in transform add test, found with 
clang-analyzer
5199be1 is described below

commit 5199be1018cbe1df2930e1cc1517bc048c74ae48
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu May 17 11:17:56 2018 -0700

    Fixed memory leak in transform add test, found with clang-analyzer
---
 proxy/InkAPITest.cc | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 731fbfb..8fae375 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -6742,16 +6742,17 @@ transformable(TSHttpTxn txnp, TransformTestData *data)
 static void
 transform_add(TSHttpTxn txnp, TransformTestData *test_data)
 {
-  TSVConn connp;
-  auto *data = new AppendTransformTestData;
-
-  data->test_data = test_data;
-  connp           = TSTransformCreate(transformtest_transform, txnp);
+  TSVConn connp = TSTransformCreate(transformtest_transform, txnp);
   if (connp == nullptr) {
-    SDK_RPRINT(data->test_data->test, "TSHttpTxnTransform", "", TC_FAIL, 
"Unable to create Transformation.");
+    SDK_RPRINT(test_data->test, "TSHttpTxnTransform", "", TC_FAIL, "Unable to 
create Transformation.");
     return;
   }
+
+  // Add data to the continuation
+  auto *data      = new AppendTransformTestData;
+  data->test_data = test_data;
   TSContDataSet(connp, data);
+
   TSHttpTxnHookAdd(txnp, TS_HTTP_RESPONSE_TRANSFORM_HOOK, connp);
   return;
 }

-- 
To stop receiving notification emails like this one, please contact
bc...@apache.org.

Reply via email to