aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index e5e83532d..191fa84cd 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -7,6 +7,19 @@
#include "util.h"
#include "log.h"
+void *tor_malloc(size_t size) {
+ void *result;
+
+ result = malloc(size);
+
+ if(!result) {
+ log(LOG_ERR,"tor_malloc(): Out of memory. Dying.");
+ exit(1);
+ }
+
+ return result;
+}
+
void
my_gettimeofday(struct timeval *timeval)
{