Skip to content

Commit 6b8e1c2

Browse files
committed
pmix/ext2x: plug misc memory leaks
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 6c66871 commit 6b8e1c2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

opal/mca/pmix/ext2x/pmix2x_client.c

Lines changed: 10 additions & 1 deletion
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.
@@ -578,6 +578,9 @@ int pmix2x_publish(opal_list_t *info)
578578
}
579579

580580
ret = PMIx_Publish(pinfo, sz);
581+
if (0 < sz) {
582+
PMIX_INFO_FREE(pinfo, sz);
583+
}
581584

582585
return pmix2x_convert_rc(ret);
583586
}
@@ -614,6 +617,9 @@ int pmix2x_publishnb(opal_list_t *info,
614617
}
615618

616619
ret = PMIx_Publish_nb(op->info, op->sz, opcbfunc, op);
620+
if (0 < op->sz) {
621+
PMIX_INFO_FREE(op->info, op->sz);
622+
}
617623

618624
return pmix2x_convert_rc(ret);
619625
}
@@ -924,6 +930,9 @@ int pmix2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
924930
job->jobid = *jobid;
925931
opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super);
926932
}
933+
if (0 < ninfo) {
934+
PMIX_INFO_FREE(pinfo, ninfo);
935+
}
927936
PMIX_APP_FREE(papps, napps);
928937

929938
return pmix2x_convert_rc(ret);

0 commit comments

Comments
 (0)