diff --git a/lib/libc/rpc/getnetpath.c b/lib/libc/rpc/getnetpath.c index 7185bdf61f38..2a4373759fdd 100644 --- a/lib/libc/rpc/getnetpath.c +++ b/lib/libc/rpc/getnetpath.c @@ -1,4 +1,4 @@ -/* $NetBSD: getnetpath.c,v 1.13 2008/04/25 17:44:44 christos Exp $ */ +/* $NetBSD: getnetpath.c,v 1.14 2008/05/24 16:04:15 christos Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)getnetpath.c 1.11 91/12/19 SMI"; #else -__RCSID("$NetBSD: getnetpath.c,v 1.13 2008/04/25 17:44:44 christos Exp $"); +__RCSID("$NetBSD: getnetpath.c,v 1.14 2008/05/24 16:04:15 christos Exp $"); #endif #endif @@ -184,8 +184,10 @@ getnetpath(handlep) if ((ncp = getnetconfigent(npp)) != NULL) { /* cobble alloc chain entry */ chainp = malloc(sizeof (struct netpath_chain)); - if (chainp == NULL) + if (chainp == NULL) { + freenetconfigent(ncp); return NULL; + } chainp->ncp = ncp; chainp->nchain_next = NULL; if (np_sessionp->ncp_list == NULL)