[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] Re: crash in imap4d/auth_gsasl.c:66 gsasl_replace_stream

From: Simon Josefsson
Subject: [bug-mailutils] Re: crash in imap4d/auth_gsasl.c:66 gsasl_replace_streams
Date: Fri, 19 Mar 2010 10:02:58 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Simon Josefsson <address@hidden> writes:

> Here is a patch for that bug, and another I found.

Actually, that leaked some memory.  Here is a better patch.


diff --git a/imap4d/auth_gsasl.c b/imap4d/auth_gsasl.c
index 3f137b0..0546e49 100644
--- a/imap4d/auth_gsasl.c
+++ b/imap4d/auth_gsasl.c
@@ -63,7 +63,6 @@ gsasl_replace_streams (void *self, void *data)
   util_set_output (s[1]);
   free (s);
   util_event_remove (self);
-  free (self);
   return 0;
@@ -99,8 +98,7 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, 
char **username)
       util_send ("+ %s\r\n", output);
       imap4d_getline (&input_str, &input_size, &input_len);
-  free (input_str);
   if (rc != GSASL_OK)
       mu_diag_output (MU_DIAG_NOTICE, _("GSASL error: %s"),
@@ -117,11 +115,13 @@ auth_gsasl (struct imap4d_command *command, char 
*auth_type, char **username)
       imap4d_getline (&input_str, &input_size, &input_len);
       if (input_len != 0)
+         free (input_str);
          mu_diag_output (MU_DIAG_NOTICE, _("non-empty client response"));
          return RESP_NO;
+  free (input_str);
   free (output);
   if (*username == NULL)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]