Skip to content

Commit 9b89505

Browse files
committed
sharedfp/sm: Fix resource leak
Fix resource leak in error handling that was identified by coverity (CID 1497839 and 1497838). Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent fcc41d7 commit 9b89505

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ompi/mca/sharedfp/sm/sharedfp_sm_file_open.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
143143
memset ( &sm_offset, 0, sizeof (struct mca_sharedfp_sm_offset ));
144144
err = opal_best_effort_write ( sm_fd, &sm_offset, sizeof(struct mca_sharedfp_sm_offset));
145145
if (OPAL_SUCCESS != err) {
146+
free(filename_basename);
147+
free(sm_filename);
148+
free(sm_data);
149+
free(sh);
150+
close (sm_fd);
146151
return err;
147152
}
148153
}

0 commit comments

Comments
 (0)