mtools/mtools-4.0.43-iconv_close.patch
Pavel Cahyna 94f8f529d5 Prevent a leak of iconv_t
Resolves: RHEL-44911
2024-08-21 14:18:17 +02:00

20 lines
596 B
Diff

diff -ur mtools-4.0.44/charsetConv.c mtools-4.0.44-memleaks/charsetConv.c
--- mtools-4.0.44/charsetConv.c 2022-09-24 10:43:03.000000000 +0200
+++ mtools-4.0.44-memleaks/charsetConv.c 2024-08-20 18:05:05.252088712 +0200
@@ -70,6 +70,7 @@
res = iconv(test,
&inbuf, &inbufLen,
&outbufP, &outbufLen);
+ iconv_close(test);
if(res != 0 || outbufLen != 0 || inbufLen != 0)
goto fail;
if(memcmp(outbuf, "ab", 2))
@@ -77,7 +78,6 @@
/* fprintf(stderr, "%s ok\n", testCp); */
return 1;
fail:
- iconv_close(test);
fail0:
/*fprintf(stderr, "%s fail\n", testCp);*/
return 0;