Skip to content

Commit

Permalink
mxqd: Use return() instead of exit()
Browse files Browse the repository at this point in the history
This is just to avoid valgrind leak warnings. We have two variables with
cleanup attribute in the scope of main, which are not freed, when we
leave by exit() instead of running out of scope.

    ==10696== 21 bytes in 1 blocks are still reachable in loss record 1 of 3
    ==10696==    at 0x4C29AC6: malloc (vg_replace_malloc.c:299)
    ==10696==    by 0x5E19449: strdup (strdup.c:42)
    ==10696==    by 0x5E750DD: get_current_dir_name (getdirname.c:40)
    ==10696==    by 0x409F64: main (mxqd.c:2383)
    ==10696==
    ==10696== 45 bytes in 1 blocks are still reachable in loss record 2 of 3
    ==10696==    at 0x4C29AC6: malloc (vg_replace_malloc.c:299)
    ==10696==    by 0x40CFF9: mx_strvec_to_str (mx_util.c:1059)
    ==10696==    by 0x409F58: main (mxqd.c:2382)
  • Loading branch information
donald committed Jul 6, 2017
1 parent ed54cf5 commit f15abe0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,6 +2553,5 @@ int main(int argc, char *argv[])
mx_log_info("cu, mx.");

mx_log_finish();

exit(0);
return(0);
}

0 comments on commit f15abe0

Please sign in to comment.