aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-27 21:19:39 -0700
committerJunio C Hamano <junkio@cox.net>2006-08-27 21:19:39 -0700
commit4cac42b1324951579036a9d3ac403f5c2c3eeed8 (patch)
tree5106e1aff2bd1d90fef4c26550b777dbe1142429 /config.c
parentb3c952f8386cebe12fc95227866683bb1cec99a9 (diff)
downloadgit-4cac42b1324951579036a9d3ac403f5c2c3eeed8.tar.gz
git-4cac42b1324951579036a9d3ac403f5c2c3eeed8.tar.xz
free(NULL) is perfectly valid.
Jonas noticed some places say "if (X) free(X)" which is totally unnecessary. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/config.c b/config.c
index 82b356245..d9f2b787b 100644
--- a/config.c
+++ b/config.c
@@ -361,8 +361,7 @@ int git_config(config_fn_t fn)
}
ret += git_config_from_file(fn, filename);
- if (repo_config)
- free(repo_config);
+ free(repo_config);
return ret;
}
@@ -734,8 +733,7 @@ int git_config_set_multivar(const char* key, const char* value,
out_free:
if (0 <= fd)
close(fd);
- if (config_filename)
- free(config_filename);
+ free(config_filename);
if (lock_file) {
unlink(lock_file);
free(lock_file);