Dangling pointers are usually bad news. Reset it back to NULL.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.c b/setup.c
index 7287779642..d193bee192 100644
--- a/setup.c
+++ b/setup.c
@@ -482,7 +482,7 @@ static int check_repository_format_gently(const char 
*gitdir, struct repository_
                        inside_work_tree = -1;
                }
        } else {
-               free(candidate->work_tree);
+               FREE_AND_NULL(candidate->work_tree);
        }
 
        return 0;
-- 
2.17.0.rc2.408.g9d2a3d914e

Reply via email to