read_revisions_from_stdin: make copies for handle_revision_arg
[gitweb.git] / revision.c
index ae12e11fb74dcc51bfddd2acf94601b2bfba7811..a50df66c50ed4c9b8118ba511f0d67fc7ed7e5ab 100644 (file)
@@ -1275,7 +1275,8 @@ static void read_revisions_from_stdin(struct rev_info *revs,
                        }
                        die("options not supported in --stdin mode");
                }
-               if (handle_revision_arg(sb.buf, revs, 0, REVARG_CANNOT_BE_FILENAME))
+               if (handle_revision_arg(xstrdup(sb.buf), revs, 0,
+                                       REVARG_CANNOT_BE_FILENAME))
                        die("bad revision '%s'", sb.buf);
        }
        if (seen_dashdash)