From: Ricardo Mones Date: Sat, 6 Feb 2016 22:49:51 +0000 (+0100) Subject: Fix segfault when account password is not saved… X-Git-Tag: 3.14.0~190 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=b7477fbe534b8d1712b27a737d55b82c2a294b97 Fix segfault when account password is not saved… …in account preferences, introduced also in 54adfb4. In this case acc_pass is NULL, so it must be checked before trying to dereference it. --- diff --git a/src/imap.c b/src/imap.c index df0fbc57f..d5df6dc18 100644 --- a/src/imap.c +++ b/src/imap.c @@ -1306,8 +1306,10 @@ try_again: return ok; } - memset(acc_pass, 0, strlen(acc_pass)); - g_free(acc_pass); + if (acc_pass) { + memset(acc_pass, 0, strlen(acc_pass)); + g_free(acc_pass); + } statuswindow_pop_all(); session->authenticated = TRUE; return MAILIMAP_NO_ERROR;