libkms: fix memory leak in error path
[glsdk/libdrm.git] / libkms / nouveau.c
index 0e24a155f857fe9d950be5fc8640620df2903bf4..608092f586d1b9dc3be7434e0f94dadf640abe3a 100644 (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;
        }