Source-Changes-HG archive

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

[src/netbsd-6]: src/lib/libc/net Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/0e5da666e68c
branches:  netbsd-6
changeset: 776614:0e5da666e68c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Apr 22 03:26:21 2014 +0000

description:
Pull up following revision(s) (requested by christos in ticket #1036):
        lib/libc/net/sethostent.c: revision 1.20
fix memory leak
XXX: pullup 6

diffstat:

 lib/libc/net/sethostent.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 135435474185 -r 0e5da666e68c lib/libc/net/sethostent.c
--- a/lib/libc/net/sethostent.c Mon Apr 21 21:04:21 2014 +0000
+++ b/lib/libc/net/sethostent.c Tue Apr 22 03:26:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sethostent.c,v 1.16.38.1 2013/12/18 22:39:32 bouyer Exp $      */
+/*     $NetBSD: sethostent.c,v 1.16.38.2 2014/04/22 03:26:21 msaitoh Exp $     */
 
 /*
  * Copyright (c) 1985, 1993
@@ -35,7 +35,7 @@
 static char sccsid[] = "@(#)sethostent.c       8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: sethostent.c,v 8.5 1996/09/28 06:51:07 vixie Exp ";
 #else
-__RCSID("$NetBSD: sethostent.c,v 1.16.38.1 2013/12/18 22:39:32 bouyer Exp $");
+__RCSID("$NetBSD: sethostent.c,v 1.16.38.2 2014/04/22 03:26:21 msaitoh Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -223,6 +223,7 @@
 
        if (num == 0) {
                *info->he = HOST_NOT_FOUND;
+               free(buf);
                return NULL;
        }
 
@@ -247,9 +248,11 @@
                HENT_SCOPY(hp->h_aliases[i], aliases[i], ptr, len);
        hp->h_aliases[anum] = NULL;
 
+       free(buf);
        return hp;
 nospc:
        *info->he = NETDB_INTERNAL;
+       free(buf);
        errno = ENOSPC;
        return NULL;
 }



Home | Main Index | Thread Index | Old Index