Merge branch 'bw/rebase-autostash-keep-current-branch'
[gitweb.git] / builtin / config.c
index 99bc7ef64ec6f7f0ab0e6dc1d0dc3fd149969a16..98d65bc0ad4fd4bee8bd2755b9d7444d9862eae8 100644 (file)
@@ -599,7 +599,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        int nongit = !startup_info->have_repository;
        char *value;
 
-       given_config_source.file = getenv(CONFIG_ENVIRONMENT);
+       given_config_source.file = xstrdup_or_null(getenv(CONFIG_ENVIRONMENT));
 
        argc = parse_options(argc, argv, prefix, builtin_config_options,
                             builtin_config_usage,