]> source.dussan.org Git - rspamd.git/commitdiff
Fix leaking of iconv descriptors.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Nov 2014 12:12:35 +0000 (12:12 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Nov 2014 12:12:35 +0000 (12:12 +0000)
src/libmime/message.c

index b93810cb03cc614d8441336dc702a051a3a34786..3a1baf798db3fcc018bb6ee9459608530366a916 100644 (file)
@@ -927,6 +927,7 @@ rspamd_text_to_utf8 (struct rspamd_task *task,
                                g_set_error (err, converter_error_quark(), EINVAL,
                                                "output of size %zd is not enough to handle "
                                                "converison of %zd bytes", outlen, len);
+                               iconv_close (ic);
                                return NULL;
                        case EILSEQ:
                        case EINVAL:
@@ -948,6 +949,8 @@ rspamd_text_to_utf8 (struct rspamd_task *task,
        *d = '\0';
        *olen = d - res;
 
+       iconv_close (ic);
+
        return res;
 }