diff options
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ref-filter.c b/ref-filter.c index d13d002270..bb79d6b9cc 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1321,10 +1321,8 @@ static struct ref_array_item *new_ref_array_item(const char *refname, const unsigned char *objectname, int flag) { - size_t len = strlen(refname); - struct ref_array_item *ref = xcalloc(1, sizeof(struct ref_array_item) + len + 1); - memcpy(ref->refname, refname, len); - ref->refname[len] = '\0'; + struct ref_array_item *ref; + FLEX_ALLOC_STR(ref, refname, refname); hashcpy(ref->objectname, objectname); ref->flag = flag; |