summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2005-04-18 03:45:23 +0000
committerdelphij <delphij@FreeBSD.org>2005-04-18 03:45:23 +0000
commit3460f32839934dda4bd0da0981978701a43bfe2a (patch)
tree91f6cdd49185dedbb44683763814bf3931c416e8 /lib
parent9052714aec93968c42abb74abbef2098e23c65a0 (diff)
downloadFreeBSD-src-3460f32839934dda4bd0da0981978701a43bfe2a.zip
FreeBSD-src-3460f32839934dda4bd0da0981978701a43bfe2a.tar.gz
Do not check whether a pointer is NULL, since free(3) already takes care of
this case. Reviewed by: ume
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/getservent.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 24c73d7..2224add 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -67,10 +67,8 @@ servent_data_clear(struct servent_data *sed)
sed->fp = NULL;
}
#ifdef YP
- if (sed->key) {
- free(sed->key);
- sed->key = NULL;
- }
+ free(sed->key);
+ sed->key = NULL;
#endif
}
@@ -201,8 +199,7 @@ _getservent_yp(struct servent_data *sed)
}
if (!sed->stepping_yp) {
- if (sed->key)
- free(sed->key);
+ free(sed->key);
rv = yp_first(sed->yp_domain, "services.byname", &sed->key,
&sed->keylen, &result, &resultlen);
if (rv) {
OpenPOWER on IntegriCloud