From 5e41a439068478a27f4b1b8af053affccacfd895 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 11 Mar 2013 11:55:27 +0100 Subject: [PATCH] cpio: fix for small memory leak in copyin.c Resolves: #919454 Version: 2.11-17 --- cpio-2.11-fix-memory-leak-in-copyin.patch | 20 ++++++++++++++++++++ cpio.spec | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 cpio-2.11-fix-memory-leak-in-copyin.patch diff --git a/cpio-2.11-fix-memory-leak-in-copyin.patch b/cpio-2.11-fix-memory-leak-in-copyin.patch new file mode 100644 index 0000000..31a0ce3 --- /dev/null +++ b/cpio-2.11-fix-memory-leak-in-copyin.patch @@ -0,0 +1,20 @@ +--- cpio-2.11.old/src/copyin.c 2013-03-08 14:25:16.153845747 +0000 ++++ cpio-2.11.fixleak/src/copyin.c 2013-03-08 14:24:53.148926140 +0000 +@@ -1486,7 +1486,7 @@ + apply_delayed_set_stat (); + + if (append_flag) +- return; ++ goto out; + + if (archive_format == arf_newascii || archive_format == arf_crcascii) + { +@@ -1501,5 +1501,8 @@ + (unsigned long) blocks), + (unsigned long) blocks); + } ++ ++ out: ++ free (file_hdr.c_name); + } + diff --git a/cpio.spec b/cpio.spec index 1ae8df9..81842b3 100644 --- a/cpio.spec +++ b/cpio.spec @@ -3,7 +3,7 @@ Summary: A GNU archiving program Name: cpio Version: 2.11 -Release: 16%{?dist} +Release: 17%{?dist} License: GPLv3+ Group: Applications/Archiving URL: http://www.gnu.org/software/cpio/ @@ -27,6 +27,8 @@ Patch6: cpio-2.11-stdio.in.patch Patch7: cpio-2.10-longnames-split.patch # cpio does Sum32 checksum, not CRC Patch8: cpio-2.11-crc-fips-nit.patch +# fix memory leak (#919454) (downstream) +Patch9: cpio-2.11-fix-memory-leak-in-copyin.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info @@ -58,6 +60,7 @@ Install cpio if you need a program to manage file archives. %patch6 -p1 -b .gnulib %patch7 -p1 -b .longnames %patch8 -p1 -b .sum32-fips +%patch9 -p1 -b .memleak-richard autoheader @@ -107,6 +110,9 @@ fi %{_infodir}/*.info* %changelog +* Mon Mar 11 2013 Pavel Raiskup - 2.11-17 +- fix small memory leak in copyin.c (#919454) + * Wed Feb 13 2013 Fedora Release Engineering - 2.11-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild