From 4cac42b1324951579036a9d3ac403f5c2c3eeed8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 27 Aug 2006 21:19:39 -0700 Subject: free(NULL) is perfectly valid. Jonas noticed some places say "if (X) free(X)" which is totally unnecessary. Signed-off-by: Junio C Hamano --- config.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 82b3562454..d9f2b787b9 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); -- cgit v1.2.3