libkms: fix memory leak in error path
[glsdk/libdrm.git] / libkms / intel.c
index 8b8249b1815f68fe63c64da8e8ba6c3fb6050feb..abae452574b86c8fb2e500fdd51d066cb9d9ebdc 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;
        }