about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-13 19:27:40 +0000
committerJames Booth <boothj5@gmail.com>2014-01-13 19:27:40 +0000
commit443b240ce4c649b81d2f27d82a300f2a6a4cea14 (patch)
tree9110b212e1e0782b5eb91fd0f227330c9096b8f5
parentdf760bed182946745b41b48889b9f5d172cd2eb5 (diff)
downloadprofani-tty-443b240ce4c649b81d2f27d82a300f2a6a4cea14.tar.gz
Fixed GString freeing before use in otr.c
-rw-r--r--src/otr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/otr.c b/src/otr.c
index d313e436..a5981138 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -130,9 +130,9 @@ otr_on_connect(ProfAccount *account)
     g_string_append(basedir, "/");
 
     if (!mkdir_recursive(basedir->str)) {
-        g_string_free(basedir, TRUE);
         log_error("Could not create %s for account %s.", basedir->str, jid);
         cons_show_error("Could not create %s for account %s.", basedir->str, jid);
+        g_string_free(basedir, TRUE);
         return;
     }
 
@@ -211,9 +211,9 @@ otr_keygen(ProfAccount *account)
     g_string_append(basedir, "/");
 
     if (!mkdir_recursive(basedir->str)) {
-        g_string_free(basedir, TRUE);
         log_error("Could not create %s for account %s.", basedir->str, jid);
         cons_show_error("Could not create %s for account %s.", basedir->str, jid);
+        g_string_free(basedir, TRUE);
         return;
     }