about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-02-27 16:02:15 +0100
committerGitHub <noreply@github.com>2020-02-27 16:02:15 +0100
commit16f5106f10e434779186c63b94d82d1ebb14d21f (patch)
tree5b1284d4c35cf121af9aa8670fbc7b31177fd862 /src/main.c
parent779c2efc1710ed5d8b4fa60e00e85731b7bb7bd7 (diff)
parentd18ec23d0a38bd538d48f7e827fec0fceb9f230d (diff)
downloadprofani-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.c14
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;
 }