From 020dd0c1c91a6e753a453082b3c3187f9e95383a Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Wed, 10 Jan 2018 14:27:46 -0600 Subject: [PATCH] Correct the sizeof() arg to memset call in test fixture. Ref #541. --- trick_source/trick_utils/comm/test/TCConnectTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trick_source/trick_utils/comm/test/TCConnectTest.cpp b/trick_source/trick_utils/comm/test/TCConnectTest.cpp index cff28821..e2cb8964 100644 --- a/trick_source/trick_utils/comm/test/TCConnectTest.cpp +++ b/trick_source/trick_utils/comm/test/TCConnectTest.cpp @@ -19,7 +19,7 @@ class TCConnectTest : public testing::Test { /* device */ device = (TCDevice *) malloc(sizeof(TCDevice)); - memset( (void *)device,'\0',sizeof(device) ); + memset( (void *)device,'\0',sizeof(TCDevice) ); device->hostname = strdup("127.0.0.1"); device->disabled = TC_COMM_FALSE; device->disable_handshaking = TC_COMM_DISABLED; @@ -29,6 +29,7 @@ class TCConnectTest : public testing::Test { void TearDown(){ + free(device->hostname); free(device); } };