Skip to content

Commit ed922a8

Browse files
author
David Wootton
committed
Fix memory leak in mca_coll_han_scatter_intra_simple
Coverity CID 1490148 Fix review comment Signed-off-by: David Wootton <dwootton@us.ibm.com>
1 parent 1dd8dc4 commit ed922a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ompi/mca/coll/han/coll_han_scatter.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,6 @@ mca_coll_han_scatter_intra_simple(const void *sbuf, int scount,
380380
root_up_rank,
381381
up_comm,
382382
up_comm->c_coll->coll_scatter_module);
383-
if(reorder_buf != sbuf){
384-
free(reorder_buf);
385-
reorder_buf = NULL;
386-
}
387383
}
388384

389385
/* 2. low scatter on nodes leaders */
@@ -401,6 +397,9 @@ mca_coll_han_scatter_intra_simple(const void *sbuf, int scount,
401397
free(tmp_buf);
402398
tmp_buf = NULL;
403399
}
400+
if (reorder_buf != sbuf) {
401+
free(reorder_buf);
402+
}
404403

405404
return OMPI_SUCCESS;
406405

0 commit comments

Comments
 (0)