aboutsummaryrefslogtreecommitdiffstats
path: root/libkms
diff options
context:
space:
mode:
authorMaxime Villard2013-01-02 09:55:50 -0600
committerJerome Glisse2013-01-02 09:55:50 -0600
commit1f4b5e11e638fc87bd0ac8e3530b407211b76d45 (patch)
tree3286cb5e44245f223370472f37c463f96865b8ca /libkms
parent0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898 (diff)
downloadexternal-libdrm-1f4b5e11e638fc87bd0ac8e3530b407211b76d45.tar.gz
external-libdrm-1f4b5e11e638fc87bd0ac8e3530b407211b76d45.tar.xz
external-libdrm-1f4b5e11e638fc87bd0ac8e3530b407211b76d45.zip
libkms: fix memory leak in error path
Signed-off-by: Maxime Villard <rustyBSD@gmx.fr> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'libkms')
-rw-r--r--libkms/intel.c1
-rw-r--r--libkms/nouveau.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b1..abae4525 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -101,6 +101,7 @@ intel_bo_create(struct kms_driver *kms,
101 pitch = (pitch + 512 - 1) & ~(512 - 1); 101 pitch = (pitch + 512 - 1) & ~(512 - 1);
102 size = pitch * ((height + 4 - 1) & ~(4 - 1)); 102 size = pitch * ((height + 4 - 1) & ~(4 - 1));
103 } else { 103 } else {
104 free(bo);
104 return -EINVAL; 105 return -EINVAL;
105 } 106 }
106 107
diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a155..608092f5 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -102,6 +102,7 @@ nouveau_bo_create(struct kms_driver *kms,
102 pitch = (pitch + 512 - 1) & ~(512 - 1); 102 pitch = (pitch + 512 - 1) & ~(512 - 1);
103 size = pitch * height; 103 size = pitch * height;
104 } else { 104 } else {
105 free(bo);
105 return -EINVAL; 106 return -EINVAL;
106 } 107 }
107 108