Skip to content

Commit

Permalink
(rasqal_variables_table_add2): Abort on name malloc failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dajobe committed Sep 20, 2023
1 parent b31d3b0 commit 99629e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rasqal_variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ rasqal_variables_table_add2(rasqal_variables_table* vt,
v->vars_table = vt;
v->type = type;
v->name = RASQAL_MALLOC(unsigned char*, name_len + 1);
if(!v->name)
goto failed;

memcpy(RASQAL_GOOD_CAST(char*, v->name), name, name_len + 1);
v->value = rasqal_new_literal_from_literal(value);

Expand Down

0 comments on commit 99629e0

Please sign in to comment.