Skip to content

Commit 142b95d

Browse files
committed
pmix/ext2x: plug misc memory leaks regarding opal_pmix2x_event_chain_t handling
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 7a3d39f commit 142b95d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

opal/mca/pmix/ext2x/pmix2x.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
4-
* Copyright (c) 2014-2016 Research Organization for Information Science
4+
* Copyright (c) 2014-2017 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
77
* All rights reserved.
@@ -294,7 +294,6 @@ static void _event_hdlr(int sd, short args, void *cbdata)
294294
if (sing->code == chain->status) {
295295
/* found it - invoke the handler, pointing its
296296
* callback function to our progression function */
297-
OBJ_RETAIN(chain);
298297
chain->sing = sing;
299298
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
300299
"%s _EVENT_HDLR CALLING SINGLE EVHDLR",
@@ -313,7 +312,6 @@ static void _event_hdlr(int sd, short args, void *cbdata)
313312
if (multi->codes[n] == chain->status) {
314313
/* found it - invoke the handler, pointing its
315314
* callback function to our progression function */
316-
OBJ_RETAIN(chain);
317315
chain->multi = multi;
318316
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
319317
"%s _EVENT_HDLR CALLING MULTI EVHDLR",
@@ -340,7 +338,6 @@ static void _event_hdlr(int sd, short args, void *cbdata)
340338
/* finally, pass it to any default handlers */
341339
if (0 < opal_list_get_size(&mca_pmix_ext2x_component.default_events)) {
342340
def = (opal_pmix2x_default_event_t*)opal_list_get_first(&mca_pmix_ext2x_component.default_events);
343-
OBJ_RETAIN(chain);
344341
chain->def = def;
345342
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
346343
"%s _EVENT_HDLR CALLING DEFAULT EVHDLR",
@@ -355,6 +352,9 @@ static void _event_hdlr(int sd, short args, void *cbdata)
355352
if (NULL != chain->final_cbfunc) {
356353
chain->final_cbfunc(PMIX_SUCCESS, chain->final_cbdata);
357354
}
355+
356+
OBJ_RELEASE(chain);
357+
358358
return;
359359
}
360360

@@ -1438,6 +1438,9 @@ static void chcon(opal_pmix2x_event_chain_t *p)
14381438
static void chdes(opal_pmix2x_event_chain_t *p)
14391439
{
14401440
OPAL_LIST_DESTRUCT(&p->results);
1441+
if (NULL != p->info) {
1442+
OPAL_LIST_RELEASE(p->info);
1443+
}
14411444
}
14421445
OBJ_CLASS_INSTANCE(opal_pmix2x_event_chain_t,
14431446
opal_list_item_t,

0 commit comments

Comments
 (0)