diff --git a/builtin/reset.c b/builtin/reset.c index f790301c1899fe..b58a4628b66d8e 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -362,7 +362,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) parse_args(&pathspec, argv, prefix, patch_mode, &rev); if (read_from_stdin) { - pathspec_from_file = "-"; + pathspec_from_file = xstrdup("-"); if (nul_term_line) pathspec_file_nul = 1; }