-rw-r--r-- | kmicromail/libetpan/mime/mailmime_decode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/libetpan/mime/mailmime_decode.c b/kmicromail/libetpan/mime/mailmime_decode.c index e48ec19..dbaeb68 100644 --- a/kmicromail/libetpan/mime/mailmime_decode.c +++ b/kmicromail/libetpan/mime/mailmime_decode.c | |||
@@ -185,49 +185,50 @@ int mailmime_encoded_phrase_parse(const char * default_fromcode, | |||
185 | 185 | ||
186 | wordutf8 = NULL; | 186 | wordutf8 = NULL; |
187 | r = charconv(tocode, default_fromcode, raw_word, | 187 | r = charconv(tocode, default_fromcode, raw_word, |
188 | strlen(raw_word), &wordutf8); | 188 | strlen(raw_word), &wordutf8); |
189 | 189 | ||
190 | switch (r) { | 190 | switch (r) { |
191 | case MAIL_CHARCONV_ERROR_MEMORY: | 191 | case MAIL_CHARCONV_ERROR_MEMORY: |
192 | free(raw_word); | 192 | free(raw_word); |
193 | res = MAILIMF_ERROR_MEMORY; | 193 | res = MAILIMF_ERROR_MEMORY; |
194 | goto free; | 194 | goto free; |
195 | 195 | ||
196 | case MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET: | 196 | case MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET: |
197 | case MAIL_CHARCONV_ERROR_CONV: | 197 | case MAIL_CHARCONV_ERROR_CONV: |
198 | free(raw_word); | 198 | free(raw_word); |
199 | res = MAILIMF_ERROR_PARSE; | 199 | res = MAILIMF_ERROR_PARSE; |
200 | goto free; | 200 | goto free; |
201 | } | 201 | } |
202 | 202 | ||
203 | if (mmap_string_append(gphrase, wordutf8) == NULL) { | 203 | if (mmap_string_append(gphrase, wordutf8) == NULL) { |
204 | free(wordutf8); | 204 | free(wordutf8); |
205 | free(raw_word); | 205 | free(raw_word); |
206 | res = MAILIMF_ERROR_MEMORY; | 206 | res = MAILIMF_ERROR_MEMORY; |
207 | goto free; | 207 | goto free; |
208 | } | 208 | } |
209 | 209 | // LUTZ fix | |
210 | free(wordutf8); | ||
210 | free(raw_word); | 211 | free(raw_word); |
211 | first = FALSE; | 212 | first = FALSE; |
212 | } | 213 | } |
213 | else if (r == MAILIMF_ERROR_PARSE) { | 214 | else if (r == MAILIMF_ERROR_PARSE) { |
214 | break; | 215 | break; |
215 | } | 216 | } |
216 | else { | 217 | else { |
217 | res = r; | 218 | res = r; |
218 | goto free; | 219 | goto free; |
219 | } | 220 | } |
220 | } | 221 | } |
221 | } | 222 | } |
222 | 223 | ||
223 | if (first) { | 224 | if (first) { |
224 | res = MAILIMF_ERROR_PARSE; | 225 | res = MAILIMF_ERROR_PARSE; |
225 | goto free; | 226 | goto free; |
226 | } | 227 | } |
227 | 228 | ||
228 | str = strdup(gphrase->str); | 229 | str = strdup(gphrase->str); |
229 | if (str == NULL) { | 230 | if (str == NULL) { |
230 | res = MAILIMF_ERROR_MEMORY; | 231 | res = MAILIMF_ERROR_MEMORY; |
231 | goto free; | 232 | goto free; |
232 | } | 233 | } |
233 | mmap_string_free(gphrase); | 234 | mmap_string_free(gphrase); |