From: Michal Kobylinski Date: Wed, 13 Apr 2016 12:15:02 +0000 (+0200) Subject: cfgfile: fix uninitialized variable on load error X-Git-Tag: spdx-start~6978 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=907dd23866be4dc2e7740cce9481a321770b1ee6;p=dpdk.git 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 --- 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);