summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/config.c b/config.c
index f14e070..0454b8b 100644
--- a/config.c
+++ b/config.c
@@ -130,7 +130,7 @@ config *parse_config(const char *filename) {
return NULL;
}
- cfg = malloc(sizeof(config));
+ cfg = calloc(1, sizeof(config));
/* Return NULL, if cfg wasn't allocated. */
if (cfg == NULL) {
@@ -138,8 +138,6 @@ config *parse_config(const char *filename) {
return NULL;
}
- memset(cfg, 0, sizeof(config));
-
while (*tmp != '\0') {
char *line = get_line(&tmp);
char *value;