From fd057498fc791b94ec83d147ec8ea1487de2aec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= Date: Sat, 11 Feb 2017 14:10:15 +0900 Subject: [PATCH] Simplify kvz_config_alloc --- src/cfg.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index dcca593c..d486c26f 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -27,15 +27,7 @@ kvz_config *kvz_config_alloc(void) { - kvz_config *cfg = (kvz_config *)malloc(sizeof(kvz_config)); - if (!cfg) { - fprintf(stderr, "Failed to allocate a config object!\n"); - return cfg; - } - - FILL(*cfg, 0); - - return cfg; + return calloc(1, sizeof(kvz_config)); } int kvz_config_init(kvz_config *cfg)