]> git.ipfire.org Git - thirdparty/git.git/blobdiff - checkout.c
strmap: enable allocations to come from a mem_pool
[thirdparty/git.git] / checkout.c
index c72e9f9773e173c0dbcb5de88bde54d5434cf808..6586e30ca5a64fe61ec982f3d5dbe188d9194258 100644 (file)
@@ -47,7 +47,7 @@ const char *unique_tracking_name(const char *name, struct object_id *oid,
 {
        struct tracking_name_data cb_data = TRACKING_NAME_DATA_INIT;
        const char *default_remote = NULL;
-       if (!git_config_get_string_const("checkout.defaultremote", &default_remote))
+       if (!git_config_get_string_tmp("checkout.defaultremote", &default_remote))
                cb_data.default_remote = default_remote;
        cb_data.src_ref = xstrfmt("refs/heads/%s", name);
        cb_data.dst_oid = oid;
@@ -55,7 +55,6 @@ const char *unique_tracking_name(const char *name, struct object_id *oid,
        if (dwim_remotes_matched)
                *dwim_remotes_matched = cb_data.num_matches;
        free(cb_data.src_ref);
-       free((char *)default_remote);
        if (cb_data.num_matches == 1) {
                free(cb_data.default_dst_ref);
                free(cb_data.default_dst_oid);