From 2aca600fa7cf73fc9179b6ca24fbd399b6d91353 Mon Sep 17 00:00:00 2001 From: Zeex Date: Sat, 7 Dec 2013 18:12:05 +0700 Subject: Allocate whole struct in one malloc() call --- subhook.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'subhook.c') diff --git a/subhook.c b/subhook.c index 037f546..7d9ea6b 100644 --- a/subhook.c +++ b/subhook.c @@ -28,25 +28,6 @@ #include "subhook.h" #include "subhook_private.h" -SUBHOOK_EXPORT subhook_t SUBHOOK_API subhook_new() { - subhook_t hook; - - if ((hook = calloc(1, sizeof(*hook))) == NULL) - return NULL; - - if (subhook_arch_new(hook) < 0) { - free(hook); - return NULL; - } - - return hook; -} - -SUBHOOK_EXPORT void SUBHOOK_API subhook_free(subhook_t hook) { - subhook_arch_free(hook); - free(hook); -} - SUBHOOK_EXPORT void *SUBHOOK_API subhook_get_src(subhook_t hook) { return hook->src; } -- cgit v1.1