]> granicus.if.org Git - mutt/commitdiff
Fix a memory leak in imap_logout_all.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 6 Dec 2000 08:27:37 +0000 (08:27 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 6 Dec 2000 08:27:37 +0000 (08:27 +0000)
imap/imap.c

index 0ccf4b10f6d90560e37cfed2800aa2ed00f4c7b2..4f7913ebb632cb733a1bf40df884530b04e1e01b 100644 (file)
@@ -82,7 +82,7 @@ void imap_logout_all (void)
 
   while (conn)
   {
-    tmp = conn;
+    tmp = conn->next;
 
     if (conn->account.type == M_ACCT_TYPE_IMAP && conn->fd >= 0)
     {
@@ -90,11 +90,10 @@ void imap_logout_all (void)
       imap_logout ((IMAP_DATA*) conn->data);
       mutt_clear_error ();
       mutt_socket_close (conn);
-
-      mutt_socket_free (tmp);
+      mutt_socket_free (conn);
     }
 
-    conn = conn->next;
+    conn = tmp;
   }
 }