Introduction
Introduction Statistics Contact Development Disclaimer Help
remove some redundant checks - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri…
Log
Files
Refs
Tags
README
LICENSE
---
commit 3717798485ae28c453c83a109d17e66188d8379d
parent 42ed4146e6040a362e67369d862daabff0a01f4b
Author: Hiltjo Posthuma <[email protected]>
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 <[email protected]>
Diffstat:
M handlr.c | 6 ++----
M 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, cha…
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, ch…
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);
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.