[Crash-utility] Error in unload_extension

Karlsson, Jan Jan.Karlsson at sonymobile.com
Mon Dec 17 13:20:38 UTC 2012


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
sonymobile.com<http://sonymobile.com/>

[cid:image001.jpg at 01CDDC60.1C5AB450]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20121217/258c7472/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2843 bytes
Desc: image001.jpg
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20121217/258c7472/attachment.jpg>


More information about the Crash-utility mailing list