notes: convert format_display_notes to struct object_id
[gitweb.git] / remote.c
index 38ca1353b9db8e25f4b105c3027f541c4c230426..fdc52d802cec6b5322689f1fda79c9cabe9dbb01 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1191,9 +1191,10 @@ static int match_explicit(struct ref *src, struct ref *dst,
                else if (is_null_oid(&matched_src->new_oid))
                        error("unable to delete '%s': remote ref does not exist",
                              dst_value);
-               else if ((dst_guess = guess_ref(dst_value, matched_src)))
+               else if ((dst_guess = guess_ref(dst_value, matched_src))) {
                        matched_dst = make_linked_ref(dst_guess, dst_tail);
-               else
+                       free(dst_guess);
+               } else
                        error("unable to push to unqualified destination: %s\n"
                              "The destination refspec neither matches an "
                              "existing ref on the remote nor\n"