From 907dd23866be4dc2e7740cce9481a321770b1ee6 Mon Sep 17 00:00:00 2001 From: Michal Kobylinski Date: Wed, 13 Apr 2016 14:15:02 +0200 Subject: [PATCH] cfgfile: fix uninitialized variable on load error CID 13323: Uninitialized scalar variable. Using uninitialized value cfg->num_sections when calling rte_cfgfile_close. Fixes: eaafbad419bf ("cfgfile: library to interpret config files") Signed-off-by: Michal Kobylinski Acked-by: Cristian Dumitrescu --- lib/librte_cfgfile/rte_cfgfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c index 75625a28fc..d72052a08e 100644 --- a/lib/librte_cfgfile/rte_cfgfile.c +++ b/lib/librte_cfgfile/rte_cfgfile.c @@ -232,6 +232,7 @@ rte_cfgfile_load(const char *filename, int flags) return cfg; error1: + cfg->num_sections = curr_section + 1; rte_cfgfile_close(cfg); error2: fclose(f); -- 2.20.1