summaryrefslogtreecommitdiff
path: root/libc/inet/rpc/rcmd.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/rcmd.c
parent43eb269ab1d216074e18dadc74c9671398dfe938 (diff)
replace "if (p) free(p)" by just "free(p)" - free(NULL) is safe.
Diffstat (limited to 'libc/inet/rpc/rcmd.c')
-rw-r--r--libc/inet/rpc/rcmd.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index 47b92751b..6a9b437bf 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -197,9 +197,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
#ifdef __ARCH_USE_MMU__
tmphstbuf = alloca (hstbuflen);
#else
- if (tmphstbuf) {
- free(tmphstbuf);
- }
+ free(tmphstbuf);
tmphstbuf = malloc (hstbuflen);
#endif
}
@@ -411,9 +409,7 @@ int ruserok(rhost, superuser, ruser, luser)
#ifdef __ARCH_USE_MMU__
buffer = alloca (buflen);
#else
- if (buffer) {
- free(buffer);
- }
+ free(buffer);
buffer = malloc (buflen);
#endif
}
@@ -780,8 +776,7 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost)
}
}
- if (buf != NULL)
- free (buf);
+ free (buf);
return retval;
}