]> git.pld-linux.org Git - packages/nfs-utils.git/blobdiff - nfs-utils-mountd-leak.patch
- http://www.citi.umich.edu/projects/nfsv4/linux/nfs-utils-patches/1.1.1-1/nfs-utils...
[packages/nfs-utils.git] / nfs-utils-mountd-leak.patch
index f03be18cd68ef94a3fb6c7500200e952ad152035..ef3827594099bed6b4ec78e5e8aaa614ce5cadb3 100644 (file)
@@ -1,20 +1,26 @@
-From: Steinar H. Gunderson <sgunderson@bigfoot.com>
-Date: Fri, 16 Mar 2007 00:26:35 +0000 (+1100)
-Subject: Fix memory leak in mountd.
-X-Git-Url: http://linux-nfs.org/cgi-bin/gitweb.cgi?p=nfs-utils;a=commitdiff;h=08964495c2a65f6228426e4565a50dae5b75834d
+commit 1cb4a250fb9f0a8ba34befa47d951430e444a58e
+Author: Steinar H. Gunderson <sesse@debian.org>
+Date:   Fri May 11 21:02:09 2007 +1000
 
-Fix memory leak in mountd.
-
-Signed-off-by: Neil Brown <neilb@suse.de>
----
+    Memory leak in mountd
+    
+    In client_compose(), free() the hostent structure returned before
+    exiting. Normally, gethostbyaddr() returns a pointer to a static
+    struct, but this hostent comes from either get_reliable_hostbyaddr() or
+    get_hostent(), both which return a pointer they privately xmalloc()ed,
+    which thus can and should be free()d.
+    
+    Signed-Off-By: Steinar H. Gunderson <sesse@debian.org>
 
+diff --git a/support/export/client.c b/support/export/client.c
+index 686c744..19b53aa 100644
 --- a/support/export/client.c
 +++ b/support/export/client.c
-@@ -329,6 +329,7 @@ add_name(char *old, char *add)
-               strcat(new, ",");
-               strcat(new, cp);
+@@ -262,6 +262,7 @@ client_compose(struct in_addr addr)
+                       name = add_name(name, clp->m_hostname);
+               }
        }
-+      free(old);
-       return new;
++      free(he);
+       return name;
  }
  
This page took 0.035767 seconds and 4 git commands to generate.