Fix CID 1491365: resource leak.
authorwwp <subscript@free.fr>
Tue, 5 Oct 2021 14:49:50 +0000 (16:49 +0200)
committerwwp <subscript@free.fr>
Tue, 5 Oct 2021 14:49:50 +0000 (16:49 +0200)
src/imap.c
src/main.c

index 1ad6cc5cab51318c441dee50888c56b8aef3fa1b..fdd048be63a484eda351e4ad57eac65aada6410f 100644 (file)
@@ -1294,6 +1294,8 @@ static IMAPSession *imap_session_new(Folder * folder,
                                SESSION(session)->sock = NULL;
                                imap_safe_destroy(session);
                        }
+                       imap_session_destroy(session);
+            session_destroy(SESSION(session));
                        return NULL;
                }
 
index 425ad02cdf9c8c17c2b475d4eac7abb4adad57d2..fab75e8df3ec0c1f40f2743b6e79c9ac9c3ade0e 100644 (file)
@@ -2366,6 +2366,7 @@ gchar *claws_get_socket_name(void)
                        /* old versions used a sock in $TMPDIR/claws-mail-$UID */
                        debug_print("Using legacy socket %s\n", socket_dir);
                        filename = g_strdup(socket_dir);
+                       g_free(socket_dir);
                        return filename;
                }