[rdate] Fixed a memory leak Resolves: #800493

Jan Horak hhorak at fedoraproject.org
Tue Mar 13 12:41:28 UTC 2012


commit 5c16906013f4f803ae07cfb1ce7a73b124b63b3f
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date:   Tue Mar 13 13:41:19 2012 +0100

    Fixed a memory leak
    Resolves: #800493

 rdate-1.4-memleak.patch |   13 +++++++++++++
 rdate.spec              |    8 +++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/rdate-1.4-memleak.patch b/rdate-1.4-memleak.patch
new file mode 100644
index 0000000..c399175
--- /dev/null
+++ b/rdate-1.4-memleak.patch
@@ -0,0 +1,13 @@
+diff -up rdate-1.4/rdate.c.debug rdate-1.4/rdate.c
+--- rdate-1.4/rdate.c.debug	2012-03-13 13:28:35.320499753 +0100
++++ rdate-1.4/rdate.c	2012-03-13 13:34:10.997139486 +0100
+@@ -322,6 +322,9 @@ int main(int argc, char *argv[])
+ 	}
+     }
+ 
++  if (hosts)
++    free(hosts);
++
+   if(!nhosts)
+     usage(1);
+   else if (!retval && !success)
diff --git a/rdate.spec b/rdate.spec
index bd430b1..6673eb4 100644
--- a/rdate.spec
+++ b/rdate.spec
@@ -1,13 +1,14 @@
 Summary: Tool for getting the date/time from a remote machine
 Name: rdate
 Version: 1.4
-Release: 18%{?dist}
+Release: 19%{?dist}
 License: GPLv2+
 Group: Applications/System
 Source: ftp://people.redhat.com/sopwith/rdate-%{version}.tar.gz
 Patch0: rdate-1.4-udp.patch
 Patch1: rdate-1.4-addrinfo.patch
 Patch2: rdate-1.4-spellerr.patch
+Patch3: rdate-1.4-memleak.patch
 URL: ftp://people.redhat.com/sopwith/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -22,6 +23,7 @@ the machine that you queried.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -DINET6"
@@ -42,6 +44,10 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_mandir}/man1/rdate.1*
 
 %changelog
+* Tue Mar 13 2012 Honza Horak <hhorak at redhat.com> - 1.4-19
+- Fixed a memory leak
+  Resolves: #800493
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4-18
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list