<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 2, 2013, at 4:08 , 凌欢 <<a href="mailto:linghuan713@126.com">linghuan713@126.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial; "><div>HI, all :</div><div>Our developers says that if set NULL to the pointer ,it can be used after released , is it right ? Following the the code which is </div><div>reported by scan-build and the type is used after release , <strong>can anyone tell me how to fix the bug ?</strong></div><div><strong>Or is it the false positive ? </strong> please see the attathed .c file for the detail which is start line 896, end line 942.</div><div> Thanks all . </div></div></blockquote></div><br><div>The false positive comes from this line:</div><div><br></div><div><table class="code" style="border-collapse: collapse; width: 3446px; font-family: monospace, monospace; font-size: 13px; line-height: 1.2em; color: rgb(0, 0, 0); "><tbody><tr><td class="line" style="padding-left: 1ex; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(204, 204, 204); white-space: pre; "> <span class="keyword" style="color: blue; ">if</span>(JCE_SUCCESS != ret) { <span class="keyword" style="color: blue; ">return</span> <span class="macro" style="color: rgb(139, 0, 139); background-color: rgb(255, 250, 205); position: relative; ">NULL</span>; }</td></tr><tr></tr></tbody></table><br></div><div>For some reason, we think that ret == JCE_SUCCESS when the allocation fails, but the path clearly shows JCE_MALLOC_ERROR being returned. So now the only question is, why does the analyzer think JCE_MALLOC_ERROR and JCE_SUCCESS can be the same thing? Are they defined as "extern Int32" instead of constants?</div><div><br></div><div>Jordan</div></body></html>