X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Ffor-each-ref.c;h=89e75c6894e6fdb2abbe464d825f5c7186a14141;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=a2b28c6962be8ea6f8882bae3d4fde9d972e78d2;hpb=ea56a7ed971f3bd547abb16a3cb9a41c00133c85;p=git.git diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index a2b28c696..89e75c689 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -228,7 +228,8 @@ static void grab_common_values(struct atom_value *val, int deref, struct object v->s = s; } else if (!strcmp(name, "objectname:short")) { - v->s = find_unique_abbrev(obj->sha1, DEFAULT_ABBREV); + v->s = xstrdup(find_unique_abbrev(obj->sha1, + DEFAULT_ABBREV)); } } }