summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2006-09-09 22:21:15 +0000
committermbr <mbr@FreeBSD.org>2006-09-09 22:21:15 +0000
commitcbf797decdfe7a5b55036e937598ff41c8c0bb74 (patch)
treed9b55c1801c7c7b98b3c86770e8b93ed0e03ab72 /lib/libc
parenta197a4c83b7e06abd0667e059c031496006533de (diff)
downloadFreeBSD-src-cbf797decdfe7a5b55036e937598ff41c8c0bb74.zip
FreeBSD-src-cbf797decdfe7a5b55036e937598ff41c8c0bb74.tar.gz
Sync with NetBSD rev. 1.15
Coverity CID 2275: Avoid memory leak on error. MFC after: 1 month
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/rpc/getnetconfig.c1
1 files changed, 1 insertions, 0 deletions
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++) {
OpenPOWER on IntegriCloud