all: include config.h only when available and use its defines
[platform/upstream/libdrm.git] / libkms / intel.c
index 8b8249b..92f1cf2 100644 (file)
@@ -26,7 +26,9 @@
  **************************************************************************/
 
 
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #define _FILE_OFFSET_BITS 64
 
 #include <errno.h>
@@ -101,6 +103,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;
        }