<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 12/10/2014 8:21 AM, Tom wrote:<br>
</div>
<blockquote
cite="mid:699ca313.22c38.14a3493dba8.Coremail.ventureg@163.com"
type="cite">
<div
style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><br>
<br>
<div>yes , you are right. I should be more careful<br>
<br>
</div>
</div>
</blockquote>
Don't feel bad. CodeSonar and Coverity have flagged <br>
multiple places that a NULL appears to be freed but <br>
upon investigation, it was intentional.<br>
<br>
It may be nice to note in a comment that it is understood<br>
that pointer X may be NULL at this point.<br>
<blockquote
cite="mid:699ca313.22c38.14a3493dba8.Coremail.ventureg@163.com"
type="cite">
<div
style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">
<div>thank you very much<br>
</div>
<br>
<br>
<br>
<pre>
At 2014-12-10 15:45:12, "Sebastian Huber" <a class="moz-txt-link-rfc2396E" href="mailto:sebastian.huber@embedded-brains.de"><sebastian.huber@embedded-brains.de></a> wrote:
>The is no bug, since we have
>
> busses[i].name = nmcpy;
> nmcpy = 0;
>
>and a free(NULL) is a nop.
>
>On 10/12/14 07:10, Tom wrote:
>> cpukit/libi2c/libi2c.c
>> rtems_libi2c_register_bus
>> this function saves the specified i2c bus name in a malloced space,
>> but in the end of this function, the malloced space is freed.
>> And in rtems_libi2c_register_drv , busses[busno].name is used to
>> construct the specific device file.
>
>--
>Sebastian Huber, embedded brains GmbH
>
>Address : Dornierstr. 4, D-82178 Puchheim, Germany
>Phone : +49 89 189 47 41-16
>Fax : +49 89 189 47 41-09
>E-Mail : <a class="moz-txt-link-abbreviated" href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>
>PGP : Public key available on request.
>
>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
</pre>
</div>
<br>
<br>
<span title="neteasefooter"><span id="netease_mail_footer"></span></span>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</body>
</html>