]> git.ipfire.org Git - thirdparty/git.git/blobdiff - branch.c
branch: fix a leak in dwim_and_setup_tracking
[thirdparty/git.git] / branch.c
index ba3914adf5b7bfdccd5b76774e1287bf52d1e749..a7333a4c32b5289e8c0d2b444c7b2cff014b557a 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -638,9 +638,10 @@ void dwim_and_setup_tracking(struct repository *r, const char *new_ref,
                             const char *orig_ref, enum branch_track track,
                             int quiet)
 {
-       char *real_orig_ref;
+       char *real_orig_ref = NULL;
        dwim_branch_start(r, orig_ref, track, &real_orig_ref, NULL);
        setup_tracking(new_ref, real_orig_ref, track, quiet);
+       free(real_orig_ref);
 }
 
 /**