diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-02-27 16:02:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 16:02:15 +0100 |
commit | 16f5106f10e434779186c63b94d82d1ebb14d21f (patch) | |
tree | 5b1284d4c35cf121af9aa8670fbc7b31177fd862 /src/main.c | |
parent | 779c2efc1710ed5d8b4fa60e00e85731b7bb7bd7 (diff) | |
parent | d18ec23d0a38bd538d48f7e827fec0fceb9f230d (diff) | |
download | profani-tty-16f5106f10e434779186c63b94d82d1ebb14d21f.tar.gz |
Merge pull request #1278 from profanity-im/memleaks
Fix few memory leaks
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index 33367743..99ccfbc0 100644 --- a/src/main.c +++ b/src/main.c @@ -60,7 +60,7 @@ #include "command/cmd_defs.h" static gboolean version = FALSE; -static char *log = "INFO"; +static char *log = NULL; static char *log_file = NULL; static char *account_name = NULL; static char *config_file = NULL; @@ -175,7 +175,17 @@ main(int argc, char **argv) return 0; } - prof_run(log, account_name, config_file, log_file); + prof_run(log ? log : "INFO", account_name, config_file, log_file); + + /* Free resources allocated by GOptionContext */ + if (log) + g_free(log); + if (account_name) + g_free(account_name); + if (config_file) + g_free(config_file); + if (log_file) + g_free(log_file); return 0; } |