--- a/tests/memload.c
+++ b/tests/memload.c
@@ -22,6 +22,7 @@
#include <hamlib/config.h>
#include <hamlib/rig.h>
+#include <stdlib.h>
#include "misc.h"
#ifdef HAVE_XML2