commit 7e91f3d2e1322160a4db79cd753888592c6fbf18 from: Omar Polo via: Thomas Adam date: Sun Jul 24 14:41:52 2022 UTC read_gitconfig: fix GOT_IGNORE_GITCONFIG case set gitconfig_remotes to NULL to avoid a double-free, and reset the global author name/email fields too. ok stsp@ commit - 2a31b33bf654723ac3cf71726e41425f7fa9ab7b commit + 7e91f3d2e1322160a4db79cd753888592c6fbf18 blob - 6a9c889ab6090565aaf97656e4066e53010a84a7 blob + 8b6a7883c5322c4c6dd57139795e92de0f5388b6 --- lib/repository.c +++ lib/repository.c @@ -682,12 +682,18 @@ read_gitconfig(struct got_repository *repo, const char &repo->gitconfig_remotes[i]); } free(repo->gitconfig_remotes); + repo->gitconfig_remotes = NULL; repo->ngitconfig_remotes = 0; free(repo->gitconfig_author_name); repo->gitconfig_author_name = NULL; free(repo->gitconfig_author_email); repo->gitconfig_author_email = NULL; + + free(repo->global_gitconfig_author_name); + repo->global_gitconfig_author_name = NULL; + free(repo->global_gitconfig_author_email); + repo->global_gitconfig_author_email = NULL; } done: