diff options
Diffstat (limited to 'mailbox/rfc2047.c')
-rw-r--r-- | mailbox/rfc2047.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mailbox/rfc2047.c b/mailbox/rfc2047.c index bc6972b72..9e043d65f 100644 --- a/mailbox/rfc2047.c +++ b/mailbox/rfc2047.c @@ -224,8 +224,11 @@ mu_rfc2047_decode (const char *tocode, const char *input, char **ptostr) free (fromcode); free (encoding_type); free (encoded_text); - - *ptostr = realloc (buffer, bufpos); + + if (status) + free (buffer); + else + *ptostr = realloc (buffer, bufpos); return status; } |