Skip to content

Commit

Permalink
build_disjunct(): Fix bad initial size of the "category" Disjunct field
Browse files Browse the repository at this point in the history
Only triggers during generation.
For issue opencog#1247.
  • Loading branch information
ampli committed Sep 16, 2021
1 parent d57493e commit 62b1244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion link-grammar/prepare/build-disjuncts.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ build_disjunct(Sentence sent, Clause * cl, const char * string,
{
ndis->num_categories_alloced = 4;
ndis->category =
malloc(sizeof(ndis->category) * ndis->num_categories_alloced);
malloc(sizeof(*ndis->category) * ndis->num_categories_alloced);
ndis->num_categories = 1;
ndis->category[0].num = strtol(string, NULL, 16);
ndis->category[1].num = 0; /* API array terminator */
Expand Down

0 comments on commit 62b1244

Please sign in to comment.