]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Memory leak in mountd
authorSteinar H. Gunderson <sesse@debian.org>
Fri, 11 May 2007 11:02:09 +0000 (21:02 +1000)
committerNeil Brown <neilb@suse.de>
Fri, 11 May 2007 11:02:09 +0000 (21:02 +1000)
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>
support/export/client.c

index 686c7448c425171ee6fec5a322d93231f07796e1..19b53aaa5f831be97aa859ea27470e0c70a95b40 100644 (file)
@@ -262,6 +262,7 @@ client_compose(struct in_addr addr)
                        name = add_name(name, clp->m_hostname);
                }
        }
+       free(he);
        return name;
 }