summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,
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;
}