about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-10-06 17:19:17 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-10-06 17:19:17 +0200
commit10f2715ea959532cce855b952a3b8a144c9a51fc (patch)
tree8beb9c85fbbf379912b9097fce02ab78e159002d /src
parent81b537b36dcec25468a0e1b1a2fe14ecb5a60ce5 (diff)
downloadprofani-tty-10f2715ea959532cce855b952a3b8a144c9a51fc.tar.gz
Free options in error case for cmd_connect()
Regards https://github.com/profanity-im/profanity/issues/1019
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_funcs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 7e0d5e37..1ee6f202 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -348,6 +348,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
     if (!parsed) {
         cons_bad_cmd_usage(command);
         cons_show("");
+        options_destroy(options);
         return TRUE;
     }
 
@@ -362,6 +363,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
             (g_strcmp0(tls_policy, "legacy") != 0)) {
         cons_bad_cmd_usage(command);
         cons_show("");
+        options_destroy(options);
         return TRUE;
     }
 
@@ -375,6 +377,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
             cons_show("");
             free(err_msg);
             port = 0;
+            options_destroy(options);
             return TRUE;
         }
     }
@@ -388,6 +391,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
         } else {
             cons_show("No default account.");
             g_free(def);
+            options_destroy(options);
             return TRUE;
         }
     }
@@ -422,6 +426,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
                 cons_show("Error evaluating password, see logs for details.");
                 account_free(account);
                 free(user);
+                options_destroy(options);
                 return TRUE;
             }