Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ftpd plug memory leak



details:   https://anonhg.NetBSD.org/src/rev/568991d2ced3
branches:  trunk
changeset: 499148:568991d2ced3
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Nov 13 11:52:41 2000 +0000

description:
plug memory leak

diffstat:

 libexec/ftpd/ftpd.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 8e490173ea79 -r 568991d2ced3 libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Mon Nov 13 11:50:46 2000 +0000
+++ b/libexec/ftpd/ftpd.c       Mon Nov 13 11:52:41 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpd.c,v 1.106 2000/11/13 11:50:46 itojun Exp $        */
+/*     $NetBSD: ftpd.c,v 1.107 2000/11/13 11:52:41 itojun Exp $        */
 
 /*
  * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpd.c     8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: ftpd.c,v 1.106 2000/11/13 11:50:46 itojun Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.107 2000/11/13 11:52:41 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -2439,11 +2439,19 @@
 parsefail:
        reply(500, "Invalid argument, rejected.");
        usedefault = 1;
+       if (tmp != NULL)
+               free(tmp);
+       if (res)
+               freeaddrinfo(res);
        return -1;
 
 protounsupp:
        epsv_protounsupp("Protocol not supported");
        usedefault = 1;
+       if (tmp != NULL)
+               free(tmp);
+       if (res)
+               freeaddrinfo(res);
        return -1;
 #else
        reply(500, "Invalid argument, rejected.");



Home | Main Index | Thread Index | Old Index