fixed memory leak
This commit is contained in:
parent
9bc33c976a
commit
2815eb7790
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ libpaper_1.1.24.tar.gz
|
|||||||
/libpaper_1.1.24+nmu1.tar.gz
|
/libpaper_1.1.24+nmu1.tar.gz
|
||||||
/libpaper_1.1.24+nmu3.tar.gz
|
/libpaper_1.1.24+nmu3.tar.gz
|
||||||
/libpaper_1.1.24+nmu4.tar.gz
|
/libpaper_1.1.24+nmu4.tar.gz
|
||||||
|
/libpaper_1.1.24+nmu5.tar.gz
|
||||||
|
22
libpaper-file-leak.patch
Normal file
22
libpaper-file-leak.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff -up libpaper-1.1.24+nmu5/lib/paper.c.file-leak libpaper-1.1.24+nmu5/lib/paper.c
|
||||||
|
--- libpaper-1.1.24+nmu5/lib/paper.c.file-leak 2018-03-09 16:21:01.028345956 +0100
|
||||||
|
+++ libpaper-1.1.24+nmu5/lib/paper.c 2018-03-09 16:40:57.824279357 +0100
|
||||||
|
@@ -140,7 +140,7 @@ char* systempapername(void) {
|
||||||
|
char* paperstr;
|
||||||
|
char* paperenv;
|
||||||
|
const char* paperdef;
|
||||||
|
- FILE* ps;
|
||||||
|
+ FILE* ps = NULL;
|
||||||
|
struct stat statbuf;
|
||||||
|
const struct paper* pp;
|
||||||
|
int c;
|
||||||
|
@@ -224,6 +224,9 @@ PAPERSIZEVAR, fall-back to the old behav
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (ps)
|
||||||
|
+ fclose(ps);
|
||||||
|
+
|
||||||
|
paperdef = defaultpapername();
|
||||||
|
paperstr = malloc((strlen(paperdef) + 1) * sizeof(char));
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: libpaper
|
Name: libpaper
|
||||||
Version: 1.1.24
|
Version: 1.1.24
|
||||||
Release: 20%{?dist}
|
Release: 21%{?dist}
|
||||||
Summary: Library and tools for handling papersize
|
Summary: Library and tools for handling papersize
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: http://packages.qa.debian.org/libp/libpaper.html
|
URL: http://packages.qa.debian.org/libp/libpaper.html
|
||||||
@ -10,6 +10,8 @@ Source0: http://ftp.debian.org/debian/pool/main/libp/libpaper/%{name}_%{version}
|
|||||||
# Filed upstream as:
|
# Filed upstream as:
|
||||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481213
|
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481213
|
||||||
Patch2: libpaper-useglibcfallback.patch
|
Patch2: libpaper-useglibcfallback.patch
|
||||||
|
# Memory leak
|
||||||
|
Patch3: libpaper-file-leak.patch
|
||||||
# gcc is no longer in buildroot by default
|
# gcc is no longer in buildroot by default
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: libtool, gettext, gawk
|
BuildRequires: libtool, gettext, gawk
|
||||||
@ -33,6 +35,7 @@ to develop applications which use libpaper.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}%{nmu}
|
%setup -q -n %{name}-%{version}%{nmu}
|
||||||
%patch2 -p1 -b .useglibcfallback
|
%patch2 -p1 -b .useglibcfallback
|
||||||
|
%patch3 -p1 -b .file-leak
|
||||||
libtoolize
|
libtoolize
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -61,11 +64,13 @@ done
|
|||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
%doc COPYING ChangeLog README
|
%doc ChangeLog README
|
||||||
|
%license COPYING
|
||||||
%config(noreplace) %{_sysconfdir}/papersize
|
%config(noreplace) %{_sysconfdir}/papersize
|
||||||
%dir %{_sysconfdir}/libpaper.d
|
%dir %{_sysconfdir}/libpaper.d
|
||||||
%{_bindir}/paperconf
|
%{_bindir}/paperconf
|
||||||
%{_libdir}/libpaper.so.*
|
%{_libdir}/libpaper.so.1.1.2
|
||||||
|
%{_libdir}/libpaper.so.1
|
||||||
%{_sbindir}/paperconfig
|
%{_sbindir}/paperconfig
|
||||||
%{_mandir}/man1/*
|
%{_mandir}/man1/*
|
||||||
%{_mandir}/man5/*
|
%{_mandir}/man5/*
|
||||||
@ -77,6 +82,9 @@ done
|
|||||||
%{_mandir}/man3/*
|
%{_mandir}/man3/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 09 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.24-21
|
||||||
|
- fixed memory leak
|
||||||
|
|
||||||
* Wed Feb 21 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.24-20
|
* Wed Feb 21 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.24-20
|
||||||
- gcc is no longer in buildroot by default
|
- gcc is no longer in buildroot by default
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user