From f15abe0812b0a78b898a0b59c37017ea55f228b2 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 6 Jul 2017 11:27:09 +0200 Subject: [PATCH] mxqd: Use return() instead of exit() 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) --- mxqd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mxqd.c b/mxqd.c index 8435e3bf..7d188810 100644 --- a/mxqd.c +++ b/mxqd.c @@ -2553,6 +2553,5 @@ int main(int argc, char *argv[]) mx_log_info("cu, mx."); mx_log_finish(); - - exit(0); + return(0); }