summaryrefslogtreecommitdiff
path: root/libc/inet/rpc/getrpcent.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-20 20:39:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-20 20:39:38 +0000
commit88917b0f143e2eac468aea14338b4d9eddba389d (patch)
tree790fd49f0632b93a7ad9cd02974bff82efa60b25 /libc/inet/rpc/getrpcent.c
parent43eb269ab1d216074e18dadc74c9671398dfe938 (diff)
replace "if (p) free(p)" by just "free(p)" - free(NULL) is safe.
Diffstat (limited to 'libc/inet/rpc/getrpcent.c')
-rw-r--r--libc/inet/rpc/getrpcent.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c
index 7b9b93758..186bd130f 100644
--- a/libc/inet/rpc/getrpcent.c
+++ b/libc/inet/rpc/getrpcent.c
@@ -93,10 +93,8 @@ void endrpcent(void)
return;
if (d->stayopen)
return;
- if (d->current) {
- free(d->current);
- d->current = NULL;
- }
+ free(d->current);
+ d->current = NULL;
if (d->rpcf) {
fclose(d->rpcf);
d->rpcf = NULL;
@@ -115,8 +113,7 @@ void setrpcent(int f)
d->rpcf = fopen(RPCDB, "r");
else
rewind(d->rpcf);
- if (d->current)
- free(d->current);
+ free(d->current);
d->current = NULL;
d->stayopen |= f;
}