refs outside refs/{heads,tags} match less strongly.
[gitweb.git] / builtin-for-each-ref.c
index 173bf38735315a1c299f1f2e3db76a7795a2305c..227aa3cd7f887ad44fd6b885479ef2afb586ded4 100644 (file)
@@ -478,9 +478,9 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct obj
                if (!strcmp(name, "subject"))
                        v->s = copy_line(subpos);
                else if (!strcmp(name, "body"))
-                       v->s = bodypos;
+                       v->s = xstrdup(bodypos);
                else if (!strcmp(name, "contents"))
-                       v->s = subpos;
+                       v->s = xstrdup(subpos);
        }
 }