summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1996-01-29 20:16:30 +0000
committermpp <mpp@FreeBSD.org>1996-01-29 20:16:30 +0000
commitbc3d519a691dae27cb75aacccb78a04639023aed (patch)
tree514db827db4058ae63ccd368c0c7db5ab20e49fb
parent12324b6255a831161c8eba00dbe6b0b633095518 (diff)
downloadFreeBSD-src-bc3d519a691dae27cb75aacccb78a04639023aed.zip
FreeBSD-src-bc3d519a691dae27cb75aacccb78a04639023aed.tar.gz
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.
-rw-r--r--lib/libc/gen/getpwent.c1
-rw-r--r--lib/libc/net/getservent.c1
2 files changed, 0 insertions, 2 deletions
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);
}
OpenPOWER on IntegriCloud