example/ip_pipeline: fix config file parse defect
PATCH 1/1 example/ip_pipeline: fix config file parse defect
Coverity issue: 120143
Fixes 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")
Signed-off-by Fan Zhang <[email protected]>
--- examples/ip_pipeline/config_parse.c | 4 ++++ 1 file changed, 4 insertions(+)
examples/ip_pipeline/config_parse.c +4 -0
@@ -1930,7 +1930,11 @@ app_config_parse(struct app_params *app, const char *file_name)APP_CHECK (cfg !=NULL ,"Unable to load config file %s" , file_name); sect_count =rte_cfgfile_num_sections (cfg,NULL ,0 ); +APP_CHECK (sect_count >0 ,"Number of sections return %d" , sect_count); + section_names =malloc (sect_count *sizeof (char *)); +APP_CHECK (section_names !=NULL ,"Failed to allocate memory" ); +for (i =0 ; i < sect_count; i++) section_names[i] =malloc (CFG_NAME_LEN );
Signature · 1 line
2.5.0
Thomas Monjalon
Applied2015-12-10 12:19, Fan Zhang:
Quoted 5 lines
Coverity issue: 120143
Fixes 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")Signed-off-by Fan Zhang <[email protected]>
Applied, thanks