Commit 5a48abe6 5a48abe69bcf247e6b481085bb22b144d1ce2bae by Simon Josefsson Committed by Sergey Poznyakoff

Bugfix.

* imap4d/auth_gsasl.c (auth_gsasl): Fix memory management.
1 parent 735a3622
...@@ -86,7 +86,7 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username) ...@@ -86,7 +86,7 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username)
86 if (rc != GSASL_OK) 86 if (rc != GSASL_OK)
87 { 87 {
88 mu_diag_output (MU_DIAG_NOTICE, _("SASL gsasl_server_start: %s"), 88 mu_diag_output (MU_DIAG_NOTICE, _("SASL gsasl_server_start: %s"),
89 gsasl_strerror(rc)); 89 gsasl_strerror (rc));
90 return 0; 90 return 0;
91 } 91 }
92 92
...@@ -100,11 +100,11 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username) ...@@ -100,11 +100,11 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username)
100 imap4d_getline (&input_str, &input_size, &input_len); 100 imap4d_getline (&input_str, &input_size, &input_len);
101 } 101 }
102 102
103 free (input_str);
104 if (rc != GSASL_OK) 103 if (rc != GSASL_OK)
105 { 104 {
106 mu_diag_output (MU_DIAG_NOTICE, _("GSASL error: %s"), 105 mu_diag_output (MU_DIAG_NOTICE, _("GSASL error: %s"),
107 gsasl_strerror (rc)); 106 gsasl_strerror (rc));
107 free (input_str);
108 free (output); 108 free (output);
109 return RESP_NO; 109 return RESP_NO;
110 } 110 }
...@@ -118,10 +118,13 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username) ...@@ -118,10 +118,13 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username)
118 if (input_len != 0) 118 if (input_len != 0)
119 { 119 {
120 mu_diag_output (MU_DIAG_NOTICE, _("non-empty client response")); 120 mu_diag_output (MU_DIAG_NOTICE, _("non-empty client response"));
121 free (input_str);
122 free (output);
121 return RESP_NO; 123 return RESP_NO;
122 } 124 }
123 } 125 }
124 126
127 free (input_str);
125 free (output); 128 free (output);
126 129
127 if (*username == NULL) 130 if (*username == NULL)
......