summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-08-24 18:19:24 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-09-04 17:02:04 -0500
commit2e8754b467914eb554a886317b88a3a654e0f58d (patch)
treeada81fe9f37f3375a604829ab3d7eacde19c930a /src
parent0c1b5c905ee077e232924f7541df73f4d2e6c862 (diff)
downloadtalos-hostboot-2e8754b467914eb554a886317b88a3a654e0f58d.tar.gz
talos-hostboot-2e8754b467914eb554a886317b88a3a654e0f58d.zip
Memory leak in splaytree and testcase.
Change-Id: I15515e3f63c8c24dc79da760b47411bf7ca6577a Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1579 Tested-by: Jenkins Server Reviewed-by: Terry J. Opie <opiet@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/util/impl/splaytree.H55
-rw-r--r--src/usr/devicefw/test/associatortest.H70
2 files changed, 69 insertions, 56 deletions
diff --git a/src/include/util/impl/splaytree.H b/src/include/util/impl/splaytree.H
index 9159ddddc..8b3743b50 100644
--- a/src/include/util/impl/splaytree.H
+++ b/src/include/util/impl/splaytree.H
@@ -1,26 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/util/impl/splaytree.h $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/util/impl/splaytree.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#ifndef __UTIL_IMPL_SPLAYTREE_H
#define __UTIL_IMPL_SPLAYTREE_H
@@ -104,6 +104,15 @@ namespace Util
new (&data_T()) T();
};
+ /** Default destructor.
+ *
+ * Call destructor on the child object.
+ */
+ ~Node()
+ {
+ data_T().~T();
+ }
+
/** Copy constructor from a Node.
*
* Initializes the node-links and copies the data storage area
diff --git a/src/usr/devicefw/test/associatortest.H b/src/usr/devicefw/test/associatortest.H
index f54734858..f960c79a9 100644
--- a/src/usr/devicefw/test/associatortest.H
+++ b/src/usr/devicefw/test/associatortest.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/devicefw/test/associatortest.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/devicefw/test/associatortest.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TEST_ASSOCIATORTEST_H
#define __TEST_ASSOCIATORTEST_H
@@ -42,7 +42,7 @@ static int64_t g_associatorTest_accessType;
class AssociatorTest: public CxxTest::TestSuite
{
public:
-
+
/**
* @test Ensure AssociationContainer can be constructed.
*/
@@ -69,7 +69,7 @@ public:
return NULL;
}
-
+
/**
* @test Verify simple registration.
*/
@@ -85,9 +85,9 @@ public:
SCOM,
TYPE_PROC,
&performOperation);
-
- errlHndl_t l_errl = as.performOp(READ,
- MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
+
+ errlHndl_t l_errl = as.performOp(READ,
+ MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
SCOM, va_list());
@@ -203,7 +203,7 @@ public:
SCOM,
TYPE_PROC,
&performOperation);
-
+
errlHndl_t l_errl = as.performOp(WRITE,
MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
@@ -229,7 +229,7 @@ public:
TS_FAIL("Invalid access type.");
}
}
-
+
/**
* @test Verify registration with a target type as a WILDCARD.
*/
@@ -245,8 +245,8 @@ public:
SCOM,
WILDCARD,
&performOperation);
-
- errlHndl_t l_errl = as.performOp(READ,
+
+ errlHndl_t l_errl = as.performOp(READ,
MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
SCOM, va_list());
@@ -272,7 +272,7 @@ public:
}
}
-
+
/**
* @test Verify missing registration returns an error log.
*/
@@ -288,7 +288,7 @@ public:
SCOM,
WILDCARD,
&performOperation);
-
+
errlHndl_t l_errl = as.performOp(READ,
MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
@@ -302,6 +302,10 @@ public:
{
TS_FAIL("Reason code different from DEVFW_RC_NO_ROUTE_FOUND.");
}
+ else
+ {
+ delete l_errl;
+ }
}
OpenPOWER on IntegriCloud