Fix memleaks in dmi.c

In dmi_init() we populate static char *dmistrings[] with values that get
later compared in dmi_match(). Those strings are actually strduped in
get_dmi_string() and hence need to be freed later. This patch accomplishes
this by registering another shutdown method. Also, the tangling pointers are
nulled when the memories are freed.

This bug was found thanks to valgrind.

Corresponding to flashrom svn r1604.

Signed-off-by: Stefan Tauner <>
Acked-by: Carl-Daniel Hailfinger <>
1 file changed