aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-kbdc/variables.c')
-rw-r--r--src/mds-kbdc/variables.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mds-kbdc/variables.c b/src/mds-kbdc/variables.c
index 7431767..155edd7 100644
--- a/src/mds-kbdc/variables.c
+++ b/src/mds-kbdc/variables.c
@@ -168,8 +168,7 @@ int variables_let(size_t variable, mds_kbdc_tree_t* restrict value)
{
/* Shadow or define. */
previous = variables[variable];
- variables[variable] = malloc(sizeof(variable_t));
- if (variables[variable] == NULL)
+ if (xmalloc(variables[variable], 1, variable_t))
fail_if (variables[variable] = previous, 1);
variables[variable]->value = value;
variables[variable]->previous = previous;