---
 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;
        }

-- 
1.7.7

Reply via email to