From 01818fdf090f0a1e0662b1a7e5c1586ecc3862be Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Sun, 29 Sep 2019 11:33:42 -0400 Subject: [PATCH] Fix rare mtcAgent segfault on process shutdown A mtcAgent core dump was observed during unit testing of another feature. Debug of that coredump revealed the segfault occured in the freeing of host object memory. Occurrence is extremely rare but at the same time there is no real need to free this memory in the destructor because the kernel, which is much better at that task, does that automatically when a proccess exits. Test Plan: PASS: Verify system install with no core dumps. PASS: Verify mtcAgent proccesss restart soak with no code dumps. Change-Id: I6107078fb802be0ef2aaf632b79e751376ba9c42 Closes-Bug: 1831956 Signed-off-by: Eric MacDonald --- mtce/src/common/nodeClass.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mtce/src/common/nodeClass.cpp b/mtce/src/common/nodeClass.cpp index 2ced49dc..f26ff29e 100755 --- a/mtce/src/common/nodeClass.cpp +++ b/mtce/src/common/nodeClass.cpp @@ -352,14 +352,7 @@ nodeLinkClass::nodeLinkClass() /* nodeLinkClass destructor */ nodeLinkClass::~nodeLinkClass() { - /* Free any allocated host memory */ - for ( int i = 0 ; i < MAX_HOSTS ; i++ ) - { - if ( node_ptrs[i] ) - { - delete node_ptrs[i] ; - } - } + ; } /* Clear start host service controls */