diff mbox

[3/6] nouveau/nouveau.c: Fix two memory leaks.

Message ID 1342204466-15460-4-git-send-email-johannesobermayr@gmx.de (mailing list archive)
State New, archived
Headers show

Commit Message

Johannes Obermayr July 13, 2012, 6:34 p.m. UTC
---
 nouveau/nouveau.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

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