Error in unload_extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

 

SONY make.believe

 

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux