svn commit: r334199 - head/usr.sbin/bhyve

Edward Tomasz Napierała trasz at freebsd.org
Fri May 25 20:11:33 UTC 2018


On 0526T0226, Marcelo Araujo wrote:
> 2018-05-26 2:21 GMT+08:00 Brooks Davis <brooks at freebsd.org>:

[..]

> > The correct code here would be one of:
> >
> > str = strdup(opt);
> > if (str == NULL)
> >         goto out;
> >
> 
> No, it is not the correct code! If we go out and free(str) we have nothing
> to free, because we even didn't allocated memory for str.

FWIW, calling free(3) on a NULL pointer is perfectly fine.



More information about the svn-src-head mailing list