Is this a bug in libi2c ?
Joel Sherrill
joel.sherrill at oarcorp.com
Wed Dec 10 14:46:55 UTC 2014
On 12/10/2014 8:21 AM, Tom wrote:
>
>
> yes , you are right. I should be more careful
>
Don't feel bad. CodeSonar and Coverity have flagged
multiple places that a NULL appears to be freed but
upon investigation, it was intentional.
It may be nice to note in a comment that it is understood
that pointer X may be NULL at this point.
> thank you very much
>
>
>
> At 2014-12-10 15:45:12, "Sebastian Huber" <sebastian.huber at embedded-brains.de> 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 : sebastian.huber at embedded-brains.de
> >PGP : Public key available on request.
> >
> >Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> >
>
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20141210/bb730558/attachment-0002.html>
More information about the devel
mailing list