diff --git a/mtools-4.0.43-iconv_close.patch b/mtools-4.0.43-iconv_close.patch new file mode 100644 index 0000000..5a98229 --- /dev/null +++ b/mtools-4.0.43-iconv_close.patch @@ -0,0 +1,19 @@ +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; diff --git a/mtools.spec b/mtools.spec index 659e3fa..86db80c 100644 --- a/mtools.spec +++ b/mtools.spec @@ -7,6 +7,7 @@ Source0: ftp://ftp.gnu.org/gnu/mtools/mtools-%{version}.tar.gz Url: https://www.gnu.org/software/mtools/ Patch0: mtools-3.9.6-config.patch Patch1: mtools-4.0.43-errmsgsize.patch +Patch2: mtools-4.0.43-iconv_close.patch BuildRequires: make BuildRequires: gcc @@ -33,6 +34,7 @@ Mtools should be installed if you need to use MS-DOS disks %setup -q -n %{name}-%{version} %patch 0 -p1 -b .conf %patch 1 -p1 +%patch 2 -p1 %build autoreconf -fiv