libkms: fix memory leak in error path
[profile/ivi/libdrm.git] / libkms / intel.c
index 8b8249b..abae452 100644 (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;
        }