cfgfile: fix uninitialized variable on load error

CID 13323:
Uninitialized scalar variable. Using uninitialized value
cfg->num_sections when calling rte_cfgfile_close.

Fixes: eaafbad419 ("cfgfile: library to interpret config files")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
Michal Kobylinski 2016-04-13 14:15:02 +02:00 committed by Thomas Monjalon
parent 182d91f35b
commit 907dd23866

View File

@ -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);