Fix a null pointer dereference introduced by 54adfb4.
authorAndrej Kacian <ticho@claws-mail.org>
Fri, 5 Feb 2016 09:43:15 +0000 (10:43 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Fri, 5 Feb 2016 09:43:15 +0000 (10:43 +0100)
acc_pass is pointing to same address as pass, and we are inside
an if block that includes "!pass" condition, so trying to zero
and free acc_pass is a wrong thing to do.

src/imap.c

index 8ccf871eda12a3b5803526834c0c124e9ebb51c2..df0fbc57f745cb33a2f46737c9280e2bb9077b4a 100644 (file)
@@ -1274,8 +1274,6 @@ try_again:
                                                            account->userid,
                                                            &(account->session_passwd));
                if (!tmp_pass) {
-                       memset(acc_pass, 0, strlen(acc_pass));
-                       g_free(acc_pass);
                        return MAILIMAP_NO_ERROR;
                }
                Xstrdup_a(pass, tmp_pass, {g_free(tmp_pass); return MAILIMAP_NO_ERROR;});