libkms: fix memory leak in error path
Signed-off-by: Maxime Villard <rustyBSD@gmx.fr> Signed-off-by: Jerome Glisse <jglisse@redhat.com>main
parent
0980633afd
commit
1f4b5e11e6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue