Skip to content

Commit f91f8ce

Browse files
author
Ralph Castain
committed
Protect against NULL param
Signed-off-by: Ralph Castain <[email protected]>
1 parent f633d5c commit f91f8ce

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

opal/mca/pmix/pmix2x/pmix2x.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,19 +1330,20 @@ static void pmix2x_log(opal_list_t *info,
13301330
pmix2x_opcaddy_t *cd;
13311331
pmix_status_t prc;
13321332

1333-
/* setup the operation */
1333+
/* create the caddy */
13341334
cd = OBJ_NEW(pmix2x_opcaddy_t);
1335-
cd->opcbfunc = cbfunc;
1336-
cd->cbdata = cbdata;
1337-
ninfo = opal_list_get_size(info);
1338-
cd->ninfo = ninfo;
13391335

13401336
/* bozo check */
1341-
if (NULL == info || 0 == ninfo) {
1337+
if (NULL == info || 0 == (ninfo = opal_list_get_size(info))) {
13421338
rc = OPAL_ERR_BAD_PARAM;
13431339
goto CLEANUP;
13441340
}
13451341

1342+
/* setup the operation */
1343+
cd->opcbfunc = cbfunc;
1344+
cd->cbdata = cbdata;
1345+
cd->ninfo = ninfo;
1346+
13461347
/* convert the list to an array of info objects */
13471348
PMIX_INFO_CREATE(cd->info, cd->ninfo);
13481349
n=0;

0 commit comments

Comments
 (0)