geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

commit 3717798485ae28c453c83a109d17e66188d8379d
parent 42ed4146e6040a362e67369d862daabff0a01f4b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 16 Jun 2017 18:21:46 +0200

remove some redundant checks

- freeelem checks for nil.
- free(nil) is valid too.

Signed-off-by: Christoph Lohmann <20h@r-36.net>

Diffstat:
handlr.c | 6++----
ind.c | 3+--
2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/handlr.c b/handlr.c @@ -172,8 +172,7 @@ handlecgi(int sock, char *file, char *port, char *base, char *args, break; default: wait(NULL); - if (path != nil) - free(path); + free(path); break; } } @@ -238,8 +237,7 @@ handledcgi(int sock, char *file, char *port, char *base, char *args, dprintf(sock, ".\r\n"); wait(NULL); - if (path != nil) - free(path); + free(path); break; } } diff --git a/ind.c b/ind.c @@ -149,8 +149,7 @@ freeindex(Indexs *i) if(i != nil) { if(i->n != nil) { for(;i->num > 0; i->num--) - if(i->n[i->num - 1] != nil) - freeelem(i->n[i->num - 1]); + freeelem(i->n[i->num - 1]); free(i->n); } free(i);