Date: Fri, 25 May 2018 21:11:28 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= <trasz@freebsd.org> To: araujo@freebsd.org Cc: Brooks Davis <brooks@freebsd.org>, Eitan Adler <lists@eitanadler.com>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334199 - head/usr.sbin/bhyve Message-ID: <20180525201128.GA97785@brick> In-Reply-To: <CAOfEmZiOPsDpzJ1citMhGvVFDFpQg1gY8-tNkj3XReYuFpDC1w@mail.gmail.com> References: <201805250207.w4P275Pf060725@repo.freebsd.org> <20180525151134.GB99063@spindle.one-eyed-alien.net> <CAOfEmZgV9yssn5v8ZpbkwL=rrifoD1Z=uRxe6a0KyM3mrXrSjQ@mail.gmail.com> <CAF6rxgm32%2B_XazDvbtyFChPigxVB0HQ30r3=CvN65ko=zHq0yA@mail.gmail.com> <CAOfEmZhS4RZPn6%2BqOcU56HUtUgGids79cS=fBKfuGjpBBQQm5g@mail.gmail.com> <20180525174424.GD99063@spindle.one-eyed-alien.net> <CAOfEmZhm3HPGU3r2nK9o3ry8%2BxpzaFRDCgw3qCKgy2CTOu3NaQ@mail.gmail.com> <20180525182139.GE99063@spindle.one-eyed-alien.net> <CAOfEmZiOPsDpzJ1citMhGvVFDFpQg1gY8-tNkj3XReYuFpDC1w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 0526T0226, Marcelo Araujo wrote: > 2018-05-26 2:21 GMT+08:00 Brooks Davis <brooks@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180525201128.GA97785>