The read_trace_config() can dereference the line pointer after freeing
it on its error path. Avoid that.
This was found by Coverity Scan.
Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com>
Cc: Simon Glass <sjg@chromium.org>
err = regcomp(&line->regex, tok, REG_NOSUB);
if (err) {
+ int r = regex_report_error(&line->regex, err,
+ "compile", tok);
free(line);
- return regex_report_error(&line->regex, err, "compile",
- tok);
+ return r;
}
/* link this new one to the end of the list */