aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/util.c b/util.c
index c7b3bc8..3a5ae9a 100644
--- a/util.c
+++ b/util.c
@@ -198,18 +198,13 @@ char* absolute_path(const char *filename)
goto end;
error:
- if (path != NULL) {
- free(path);
- path = NULL;
- }
+ free(path);
+ path = NULL;
end:
- if (dirname != NULL)
- free(dirname);
- if (cwd != NULL)
- free(cwd);
- if (twd != NULL)
- free(twd);
+ free(dirname);
+ free(cwd);
+ free(twd);
return path;
}
@@ -254,7 +249,7 @@ int r_closedir(r_dir_t *rdir)
rdir->dir = NULL;
}
- if (rdir->d != 0 && rdir->name != NULL) {
+ if (rdir->d != 0) {
free(rdir->name);
rdir->name = NULL;
}