Debian: Fix mtcAgent segfault on SM host state change requests

The mtcAgent communicates to Service Managenment using libEvent.

The host state change notification requests are all blocking
requests. Both the common and service manager handlers are
freeing the object. This double free results in a segmentation
fault with the newer version of libEvent in Debian.

The bug is fixed by removing the free in the service handler
to allow the dispatch handler to manage the object free as it
does for other blocking requests for other services.

Test Plan:

PASS: Verify mtcAgent does not crash on SM state change request
PASS: Verify all blocking state change requests
PASS: Verify no memory leak (before ; request stress ; after)

Regression:

PASS: Verify Debian Build and Install (duplex/duplex)
PASS: Verify CentOS Build and Patch (duplex)
PASS: Verify CentOS Swact
PASS: Verify Logging

Story: 2009968
Task: 45675
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: Iad27a0e77cb9d2233a2f2e1b6f8216b93964335b
This commit is contained in:
Eric MacDonald 2022-06-23 21:05:26 +00:00
parent 0be0bf48e4
commit f7f552ad8e
1 changed files with 0 additions and 3 deletions

View File

@ -62,9 +62,6 @@ mtcSmgrApi_handler_out:
if ( smgrEvent.blocking == true )
{
mtcHttpUtil_free_conn ( smgrEvent );
mtcHttpUtil_free_base ( smgrEvent );
/* This is needed to get out of the loop in the blocking case
* Calling this here in non-blocking calls can lead to segfault */
event_base_loopbreak((struct event_base *)arg);