From cbf797decdfe7a5b55036e937598ff41c8c0bb74 Mon Sep 17 00:00:00 2001 From: mbr Date: Sat, 9 Sep 2006 22:21:15 +0000 Subject: 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 0159e4b..846419d 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++) { -- cgit v1.1