From 8f0edf314a9c9198d95b0c7598e269cf8b7f232a Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Mon, 1 Dec 2014 11:48:01 -0600 Subject: IPMI Fru Inventory Record Creation Change-Id: I9339e267ff7d2e2edbf4305d8c2d57f73f0c5eeb RTC:108829 Depends-on:I3c0c4c7c14521f1b64af37d62e57a5947602ed11 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14666 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/vpd/test/spdtest.H | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/usr/vpd/test') diff --git a/src/usr/vpd/test/spdtest.H b/src/usr/vpd/test/spdtest.H index 83de74c7f..c94e8af98 100755 --- a/src/usr/vpd/test/spdtest.H +++ b/src/usr/vpd/test/spdtest.H @@ -736,7 +736,9 @@ class SPDTest: public CxxTest::TestSuite // Test on first DIMM only. theTarget = dimmList[0]; - uint8_t * theData = NULL; + //If theData is NULL, deviceRead will return the size + // need to give this an arbitrary size so test is still valid` + uint8_t * theData = static_cast(malloc( 0x1 )); size_t theSize = 0x0; // Invalid size of 0x0 cmds++; @@ -745,6 +747,12 @@ class SPDTest: public CxxTest::TestSuite theSize, DEVICE_SPD_ADDRESS( SPD::SPD_FIRST_NORM_KEYWORD ) ); + // clean up the data + if( NULL != theData ) + { + delete theData; + theData = NULL; + } if( NULL == err ) { fails++; -- cgit v1.2.1