libkms: fix memory leak in error path

Signed-off-by: Maxime Villard <rustyBSD@gmx.fr>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
main
Maxime Villard 2013-01-02 10:55:50 -05:00 committed by Jerome Glisse
parent 0980633afd
commit 1f4b5e11e6
2 changed files with 2 additions and 0 deletions

View File

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

View File

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