<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=SV link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>I was running valgrind to check some of my own code and then stumbled upon the following:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>In function unload_extension (extensions.c) last loop:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>   for (ext = extension_table, found = FALSE; ext; ext = ext->next) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>in the loop free(ext) is performed and then ext is accessed again in the loop control statement. Fix:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>- either test for “!found && ext” in loop control or<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>- break the loop if the free statement has executed.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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.<o:p></o:p></span></p><div><div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Helvetica","sans-serif";color:black'>Jan<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal style='mso-line-height-alt:10.5pt'><b><span lang=EN-US style='font-size:11.5pt;font-family:"Helvetica","sans-serif";color:black'>Jan Karlsson</span></b><b><span lang=EN-US style='font-size:11.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p></o:p></span></b></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#222222'>Senior Software Engineer<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#222222'>MIB<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#222222'> <o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#222222'>Sony Mobile Communications<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#222222'>Tel: +46703062174<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#002AFF'><a href="http://sonymobile.com/"><span lang=EN-US style='color:#002AFF'>sonymobile.com</span></a></span><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#002AFF'><o:p></o:p></span></p><p class=MsoNormal style='mso-line-height-alt:12.75pt'><span lang=EN-US style='font-size:13.0pt;font-family:"Helvetica","sans-serif";color:#222222'> <o:p></o:p></span></p><p class=MsoNormal><img border=0 width=102 height=35 id="Picture_x0020_1" src="cid:image001.jpg@01CDDC60.1C5AB450" alt="SONY make.believe"><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p></div></div></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>