Bug: https://bugs.gentoo.org/898060
--- a/src/memdbg.c
+++ b/src/memdbg.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <malloc.h>
 #include <fcntl.h>
 #ifndef WIN32