Use Client_find_by_session() instead of a few open-coded loops.
[umurmur.git] / src / memory.c
index 1a0ed18b041a4bf71bacacaead9ccbe201e43e63..3d52278bd69bc4179b68836e8ffbebe3ada99487 100644 (file)
 */
 #include <stdint.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 #include "log.h"
 #include "memory.h"
 
 void * Memory_safeMalloc(size_t nmem, size_t size) {
        // Check if we're going to overflow.
-       if (size && num > SIZE_MAX / size)
+       if (size && nmem > SIZE_MAX / size)
                Log_fatal("Request for memory would've overflowed.");
 
        // Allocate the memory requested.