Skip to content

Commit 35f8179

Browse files
author
Ralph Castain
committed
Fix coverity issues
Signed-off-by: Ralph Castain <[email protected]>
1 parent c0bcd11 commit 35f8179

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

opal/mca/pmix/pmix2x/pmix/src/mca/psensor/file/psensor_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void ft_destructor(file_tracker_t *ft)
113113
if (NULL != ft->id) {
114114
free(ft->id);
115115
}
116-
if (event_active) {
116+
if (ft->event_active) {
117117
pmix_event_del(&ft->ev);
118118
}
119119
if (NULL != ft->file) {

opal/mca/pmix/pmix2x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static void ft_destructor(pmix_heartbeat_trkr_t *ft)
8888
if (NULL != ft->id) {
8989
free(ft->id);
9090
}
91-
if (event_active) {
91+
if (ft->event_active) {
9292
pmix_event_del(&ft->ev);
9393
}
9494
if (NULL != ft->info) {

orte/mca/odls/base/odls_base_default_fns.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,17 +1113,26 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
11131113
}
11141114
if (NULL != effective_dir) {
11151115
free(effective_dir);
1116+
effective_dir = NULL;
11161117
}
11171118
}
11181119

11191120
GETOUT:
1121+
if (NULL != effective_dir) {
1122+
free(effective_dir);
1123+
effective_dir = NULL;
1124+
}
11201125
/* tell the state machine that all local procs for this job
11211126
* were launched so that it can do whatever it needs to do,
11221127
* like send a state update message for all procs to the HNP
11231128
*/
11241129
ORTE_ACTIVATE_JOB_STATE(jobdat, ORTE_JOB_STATE_LOCAL_LAUNCH_COMPLETE);
11251130

11261131
ERROR_OUT:
1132+
if (NULL != effective_dir) {
1133+
free(effective_dir);
1134+
effective_dir = NULL;
1135+
}
11271136
/* ensure we reset our working directory back to our default location */
11281137
chdir(basedir);
11291138
/* release the event */
@@ -1716,6 +1725,9 @@ int orte_odls_base_default_restart_proc(orte_proc_t *child,
17161725
/* setup the path */
17171726
if (ORTE_SUCCESS != (rc = setup_path(app, &wdir))) {
17181727
ORTE_ERROR_LOG(rc);
1728+
if (NULL != wdir) {
1729+
free(wdir);
1730+
}
17191731
goto CLEANUP;
17201732
}
17211733

orte/mca/schizo/slurm/schizo_slurm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,11 @@ static int get_remaining_time(uint32_t *timeleft)
148148
}
149149
if (NULL == fgets(output, 256, fp)) {
150150
free(cmd);
151+
pclose(fp);
151152
return ORTE_ERR_FILE_READ_FAILURE;
152153
}
153154
free(cmd);
155+
pclose(fp);
154156
/* the output is returned in a colon-delimited set of fields */
155157
res = opal_argv_split(output, ':');
156158
cnt = opal_argv_count(res);

0 commit comments

Comments
 (0)