[Mesa-dev] [libdrm PATCH 3/4] nouveau/nouveau.c: Fix two memory leaks.
Johannes Obermayr
johannesobermayr at gmx.de
Thu Jun 28 14:34:12 PDT 2012
Am Donnerstag, 28. Juni 2012, 23:26:25 schrieb Marcin Slusarz:
> On Thu, Jun 28, 2012 at 11:11:51PM +0200, Johannes Obermayr wrote:
> > Am Donnerstag, 28. Juni 2012, 23:06:10 schrieb Marcin Slusarz:
> > > On Thu, Jun 28, 2012 at 09:51:57PM +0200, Johannes Obermayr wrote:
> > > > ---
> > > > nouveau/nouveau.c | 2 ++
> > > > 1 files changed, 2 insertions(+), 0 deletions(-)
> > > >
> > > > diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
> > > > index 5aa4107..e91287f 100644
> > > > --- a/nouveau/nouveau.c
> > > > +++ b/nouveau/nouveau.c
> > > > @@ -95,6 +95,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev)
> > > > (dev->drm_version < 0x01000000 ||
> > > > dev->drm_version >= 0x02000000)) {
> > > > nouveau_device_del(&dev);
> > > > + free(nvdev);
> > > > return -EINVAL;
> > > > }
> > > >
> > > > @@ -105,6 +106,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev)
> > > > ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, &gart);
> > > > if (ret) {
> > > > nouveau_device_del(&dev);
> > > > + free(nvdev);
> > > > return ret;
> > > > }
> > > >
> > >
> > > nouveau_device_del already does it.
> > > NAK
> > >
> > > Marcin
> >
> > nvdev != &dev or I am wrong?
>
> dev is a prefix of nvdev.
> Just read the code...
>
> Marcin
Here is scan-build output. If it is really a false positive I will report it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120628/15e9013e/attachment-0001.html>
More information about the mesa-dev
mailing list