--- a/src/pack.c
+++ b/src/pack.c
@@ -16,8 +16,6 @@
 extern sds sdsnewlen(const void *init, size_t initlen);
 #endif
 
-#include <hiredis/sdsalloc.h>
-
 PyObject *
 pack_command(PyObject *cmd)
 {
@@ -32,7 +30,7 @@
     }
 
     Py_ssize_t tokens_number = PyTuple_Size(cmd);
-    sds *tokens = s_malloc(sizeof(sds) * tokens_number);
+    sds *tokens = sds_malloc(sizeof(sds) * tokens_number);
     if (tokens == NULL)
     {
         return PyErr_NoMemory();
