From 30b846826905b4da76f59a212a31928bd55e9783 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 24 Nov 2020 04:09:11 +0100 Subject: Minor cleanups with cfg_allocz() Also fixes some more failed asserts due to add_tail(). --- conf/cf-lex.l | 2 +- conf/confbase.Y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'conf') diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 9ea05e9d..05288b1a 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -737,7 +737,7 @@ cf_lex_init(int is_cli, struct config *c) void cf_push_scope(struct symbol *sym) { - struct sym_scope *s = cfg_alloc(sizeof(struct sym_scope)); + struct sym_scope *s = cfg_allocz(sizeof(struct sym_scope)); s->next = conf_this_scope; conf_this_scope = s; diff --git a/conf/confbase.Y b/conf/confbase.Y index f0343a93..67dcac6c 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -148,7 +148,7 @@ conf: definition ; definition: DEFINE symbol '=' term ';' { - struct f_val *val = cfg_alloc(sizeof(struct f_val)); + struct f_val *val = cfg_allocz(sizeof(struct f_val)); if (f_eval(f_linearize($4), cfg_mem, val) > F_RETURN) cf_error("Runtime error"); cf_define_symbol($2, SYM_CONSTANT | val->type, val, val); } -- cgit v1.2.3