--- a/src/lzmq.c
+++ b/src/lzmq.c
@@ -23,6 +23,7 @@
 #include <assert.h>
 #include "zsupport.h"
 #include <memory.h>
+#include <stdlib.h>
 
 #define LUAZMQ_MODULE_NAME      "lzmq"
 #define LUAZMQ_MODULE_LICENSE   "MIT"
