From bc3d519a691dae27cb75aacccb78a04639023aed Mon Sep 17 00:00:00 2001 From: mpp Date: Mon, 29 Jan 1996 20:16:30 +0000 Subject: Getpwent() and getservent() can wind up calling free() with an invalid pointer if a call to yp_first() fails. Closes PR # 964, and possibly # 952. --- lib/libc/gen/getpwent.c | 1 - lib/libc/net/getservent.c | 1 - 2 files changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index a3e32ad..70a2c98 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -650,7 +650,6 @@ _havemaster(char *_pw_yp_domain) if (yp_first(_pw_yp_domain, "master.passwd.byname", &key, &keylen, &result, &resultlen)) { - free(result); return 0; } free(result); diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 9fb47b6..35e535a 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -78,7 +78,6 @@ _getypservent(line) free(key); if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen, &result, &resultlen))) { - free(result); serv_stepping_yp = 0; return(0); } -- cgit v1.1