From: Arran Cudbard-Bell Date: Wed, 27 Jan 2021 02:03:43 +0000 (+0000) Subject: Avoid zeroing out memory and then filling it with data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8cc8c734434efd13c712782a3a34c99f1158bda;p=thirdparty%2Ffreeradius-server.git Avoid zeroing out memory and then filling it with data --- diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index e6d0b696c8..305c0d20ef 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -1047,14 +1047,13 @@ static int process_include(cf_stack_t *stack, CONF_SECTION *parent, char const * stack->depth++; frame = &stack->frame[stack->depth]; - - memset(frame, 0, sizeof(*frame)); - - frame->type = CF_STACK_DIR; - frame->directory = directory; - frame->parent = parent; - frame->current = parent; - frame->from_dir = true; + *frame = (cf_stack_frame_t){ + .type = CF_STACK_DIR, + .directory = directory, + .parent = parent, + .current = parent, + .from_dir = true + }; MEM(frame->heap = fr_heap_alloc(frame->directory, filename_cmp, cf_file_heap_t, heap_id));