I was running valgrind to check some of my own code and then stumbled upon the following:
In function unload_extension (extensions.c) last loop:
for (ext = extension_table, found = FALSE; ext; ext = ext->next) {
in the loop free(ext) is performed and then ext is accessed again in the loop control statement. Fix:
- either test for “!found && ext” in loop control or
- break the loop if the free statement has executed.
Note that there is also a risk that the loop continues (with current code), even if found becomes true, as ext->next is not changed.
Jan
Jan Karlsson
Senior Software Engineer
MIB
Sony Mobile Communications
Tel: +46703062174