From ed072abb6b72a07bb9e5798c42cf0601c3a4e7a9 Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Tue, 6 Jul 2021 20:07:18 +0200 Subject: [PATCH] bdk: revert updating ini.c --- bdk/utils/ini.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bdk/utils/ini.c b/bdk/utils/ini.c index 5088f51..ff4d3a3 100644 --- a/bdk/utils/ini.c +++ b/bdk/utils/ini.c @@ -66,14 +66,14 @@ ini_sec_t *_ini_create_section(link_t *dst, ini_sec_t *csec, char *name, u8 type int ini_parse(link_t *dst, char *ini_path, bool is_dir) { - FIL fp; u32 lblen; u32 pathlen = strlen(ini_path); u32 k = 0; + char lbuf[512]; + char *filelist = NULL; + FIL fp; ini_sec_t *csec = NULL; - char *lbuf = NULL; - char *filelist = NULL; char *filename = (char *)malloc(256); strcpy(filename, ini_path); @@ -114,7 +114,8 @@ int ini_parse(link_t *dst, char *ini_path, bool is_dir) return 0; } - lbuf = malloc(512); + csec = _ini_create_section(dst, csec, "Unknown", INI_CHOICE); + list_init(&csec->kvs); do { @@ -170,7 +171,6 @@ int ini_parse(link_t *dst, char *ini_path, bool is_dir) } } while (is_dir); - free(lbuf); free(filename); free(filelist);