X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=attr.c;h=a0712543b2076a90f38d36c5ed0e8efa2639e316;hb=952c8c56380734d45bddf369fe478895672c5a3a;hp=285e689e5adff6237e179f5d64f11d3f3c09a09d;hpb=520635fa3a7781cce412f6b02e165b5d897a99d1;p=git.git diff --git a/attr.c b/attr.c index 285e689e5..a0712543b 100644 --- a/attr.c +++ b/attr.c @@ -300,7 +300,8 @@ static struct attr_stack *read_attr_from_array(const char **list) a = parse_attr_line(line, "[builtin]", ++lineno, 1); if (!a) continue; - res->attrs = xrealloc(res->attrs, res->num_matches + 1); + res->attrs = xrealloc(res->attrs, + sizeof(struct match_attr *) * (res->num_matches + 1)); res->attrs[res->num_matches++] = a; } return res; @@ -324,7 +325,8 @@ static struct attr_stack *read_attr_from_file(const char *path, int macro_ok) a = parse_attr_line(buf, path, ++lineno, macro_ok); if (!a) continue; - res->attrs = xrealloc(res->attrs, res->num_matches + 1); + res->attrs = xrealloc(res->attrs, + sizeof(struct match_attr *) * (res->num_matches + 1)); res->attrs[res->num_matches++] = a; } fclose(fp);