Skip to content

Commit 09afbcf

Browse files
codypssofar
authored andcommitted
store: close the right smaps and set to NULL on close
1 parent 1dc6a2a commit 09afbcf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/store.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ static void garbage_collect_dead_processes(struct ps_struct *ps_first) {
106106
/* close the stream and fds */
107107
ps_next->schedstat = safe_close(ps_next->schedstat);
108108
ps_next->sched = safe_close(ps_next->sched);
109-
if (ps->smaps)
110-
fclose(ps->smaps);
109+
if (ps_next->smaps) {
110+
fclose(ps_next->smaps);
111+
ps_next->smaps = NULL;
112+
}
111113

112114
ps->next_running = ps_next->next_running;
113115
} else {

0 commit comments

Comments
 (0)