remote: separate out the remote_find_tracking logic into query_refspecs
[gitweb.git] / builtin / fetch.c
index e422ced9299521bb2e7f3c5ff59a434c8403a4ea..605d1bfd66dfcfdba04073454a784737805d6bcc 100644 (file)
@@ -918,7 +918,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
        atexit(unlock_pack);
        refspec = parse_fetch_refspec(ref_nr, refs);
        exit_code = do_fetch(transport, refspec, ref_nr);
-       free(refspec);
+       free_refspec(ref_nr, refspec);
        transport_disconnect(transport);
        transport = NULL;
        return exit_code;