Skip to content

Commit

Permalink
FIX WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Sep 16, 2024
1 parent 93543a9 commit 549d12d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cobc/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3453,7 +3453,7 @@ get_number_in_parentheses (const unsigned char ** p,
/* Copy name, CHECKME: Shouldn't we limit that - and can use
a fixed-buffer here instead? */
name_length = close_paren - open_paren;
name_buff = cobc_malloc (name_length);
name_buff = cobc_parse_malloc (name_length); /////// cobc_malloc
memcpy (name_buff, open_paren + 1, name_length - 1);
name_buff[name_length - 1] = '\0';

Expand All @@ -3462,7 +3462,7 @@ get_number_in_parentheses (const unsigned char ** p,

if (item == cb_error_node) {
*error_detected = 1;
cobc_free (name_buff);
cobc_parse_free (name_buff); ////// cobc_free
return 1;
}
if (CB_FIELD_P (item)) {
Expand All @@ -3471,7 +3471,7 @@ get_number_in_parentheses (const unsigned char ** p,
if (!(f && f->flag_item_78)) {
cb_error (_("'%s' is not a constant-name"), name_buff);
*error_detected = 1;
cobc_free (name_buff);
cobc_parse_free (name_buff); ////// cobc_free
return 1;
}

Expand All @@ -3484,7 +3484,7 @@ get_number_in_parentheses (const unsigned char ** p,
|| l->sign != 0) {
cb_error (_("'%s' is not an unsigned positive integer"), name_buff);
*error_detected = 1;
cobc_free (name_buff);
cobc_parse_free (name_buff); ////// cobc_free
return 1;
}

Expand Down

0 comments on commit 549d12d

Please sign in to comment.