summaryrefslogtreecommitdiff
path: root/libkms
diff options
context:
space:
mode:
authorMaxime Villard <rustyBSD@gmx.fr>2013-01-02 10:55:50 -0500
committerJerome Glisse <jglisse@redhat.com>2013-01-02 10:55:50 -0500
commit1f4b5e11e638fc87bd0ac8e3530b407211b76d45 (patch)
tree3286cb5e44245f223370472f37c463f96865b8ca /libkms
parent0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898 (diff)
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 8b8249b1815f..abae452574b8 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -101,6 +101,7 @@ intel_bo_create(struct kms_driver *kms,
pitch = (pitch + 512 - 1) & ~(512 - 1);
size = pitch * ((height + 4 - 1) & ~(4 - 1));
} else {
+ free(bo);
return -EINVAL;
}
diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a155f857..608092f586d1 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -102,6 +102,7 @@ nouveau_bo_create(struct kms_driver *kms,
pitch = (pitch + 512 - 1) & ~(512 - 1);
size = pitch * height;
} else {
+ free(bo);
return -EINVAL;
}