From b0718451b8d6dd382c5da6b3d5d8f2ac08f2be4e Mon Sep 17 00:00:00 2001 From: Martin Blapp Date: Sat, 9 Sep 2006 22:21:15 +0000 Subject: [PATCH] Sync with NetBSD rev. 1.15 Coverity CID 2275: Avoid memory leak on error. MFC after: 1 month --- lib/libc/rpc/getnetconfig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c index 0159e4b3721..846419d149e 100644 --- a/lib/libc/rpc/getnetconfig.c +++ b/lib/libc/rpc/getnetconfig.c @@ -692,6 +692,7 @@ struct netconfig *ncp; p->nc_lookups = (char **)malloc((size_t)(p->nc_nlookups+1) * sizeof(char *)); if (p->nc_lookups == NULL) { free(p->nc_netid); + free(p); return(NULL); } for (i=0; i < p->nc_nlookups; i++) {