diff --git a/libpaper-covscan.patch b/libpaper-covscan.patch new file mode 100644 index 0000000..43d0794 --- /dev/null +++ b/libpaper-covscan.patch @@ -0,0 +1,16 @@ +diff --git a/lib/paper.c b/lib/paper.c +index 57db599..8817aea 100644 +--- a/lib/paper.c ++++ b/lib/paper.c +@@ -211,7 +211,10 @@ PAPERSIZEVAR, fall-back to the old behaviour. + fclose(ps); + + paperstr = malloc((strlen(papername) + 1) * sizeof(char)); +- if (! paperstr) return 0; ++ if (! paperstr) { ++ free(papername); ++ return 0; ++ } + + strcpy(paperstr, papername); + free(papername); diff --git a/libpaper.spec b/libpaper.spec index 60a9702..2f30335 100644 --- a/libpaper.spec +++ b/libpaper.spec @@ -2,7 +2,7 @@ Name: libpaper Version: 1.1.24 -Release: 22%{?dist} +Release: 23%{?dist} Summary: Library and tools for handling papersize License: GPLv2 URL: http://packages.qa.debian.org/libp/libpaper.html @@ -12,6 +12,8 @@ Source0: http://ftp.debian.org/debian/pool/main/libp/libpaper/%{name}_%{version} Patch2: libpaper-useglibcfallback.patch # Memory leak Patch3: libpaper-file-leak.patch +# memory leak found by covscan, reported to debian upstream +Patch4: libpaper-covscan.patch # gcc is no longer in buildroot by default BuildRequires: gcc BuildRequires: libtool, gettext, gawk @@ -36,6 +38,7 @@ to develop applications which use libpaper. %setup -q -n %{name}-%{version}%{nmu} %patch2 -p1 -b .useglibcfallback %patch3 -p1 -b .file-leak +%patch4 -p1 -b .covscan libtoolize %build @@ -82,6 +85,9 @@ done %{_mandir}/man3/* %changelog +* Mon Dec 03 2018 Zdenek Dohnal - 1.1.24-23 +- fixing covscan issue - memory leak + * Fri Jul 13 2018 Fedora Release Engineering - 1.1.24-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild