diff options
author | Maxime Villard <rustyBSD@gmx.fr> | 2013-01-02 10:55:50 -0500 |
---|---|---|
committer | Jerome Glisse <jglisse@redhat.com> | 2013-01-02 10:55:50 -0500 |
commit | 1f4b5e11e638fc87bd0ac8e3530b407211b76d45 (patch) | |
tree | 3286cb5e44245f223370472f37c463f96865b8ca | |
parent | 0980633afd9c7eecc0c75ef3bea4d3c6b7aa1898 (diff) |
libkms: fix memory leak in error path
Signed-off-by: Maxime Villard <rustyBSD@gmx.fr>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
-rw-r--r-- | libkms/intel.c | 1 | ||||
-rw-r--r-- | libkms/nouveau.c | 1 |
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, 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 0e24a155..608092f5 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; } |