Skip to content

Commit

Permalink
daemon-unix: Fix leak of a fork error message.
Browse files Browse the repository at this point in the history
19 bytes in 1 blocks are definitely lost in loss record 24 of 121
    at 0x4839748: malloc (vg_replace_malloc.c:306)
    by 0x483BD63: realloc (vg_replace_malloc.c:834)
    by 0x521C26: xrealloc (util.c:149)
    by 0x478F91: ds_reserve (dynamic-string.c:63)
    by 0x47928B: ds_put_format_valist (dynamic-string.c:161)
    by 0x47920A: ds_put_format (dynamic-string.c:142)
    by 0x506DE5: process_status_msg (process.c:0)
    by 0x52A6D0: fork_and_wait_for_startup (daemon-unix.c:284)
    by 0x52A54D: daemonize_start (daemon-unix.c:453)
    by 0x40EB3E: main (ovs-vswitchd.c:91)

Fixes: b925336 ("daemon: restart child process if it died before signaling its readiness")
Signed-off-by: Ilya Maximets <[email protected]>
Acked-by: Roi Dayan <[email protected]>
  • Loading branch information
igsilya committed Jul 25, 2021
1 parent daf627f commit b8b31d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/daemon-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ fork_and_wait_for_startup(int *fdp, pid_t *child_pid)
VLOG_ERR("fork child died before signaling startup (%s)",
status_msg);
ret = -1;
free(status_msg);
}
} else if (retval < 0) {
VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno));
Expand Down

0 comments on commit b8b31d8

Please sign in to comment.