diff options
author | Zeex <zeex@rocketmail.com> | 2013-12-07 18:12:05 +0700 |
---|---|---|
committer | Zeex <zeex@rocketmail.com> | 2013-12-07 18:12:05 +0700 |
commit | 2aca600fa7cf73fc9179b6ca24fbd399b6d91353 (patch) | |
tree | cb4224c2e1032269980af1684a52c561b589fb61 /subhook.c | |
parent | 88d878cc687dd4fab537b5684823cd77a797c25a (diff) | |
download | subhook-2aca600fa7cf73fc9179b6ca24fbd399b6d91353.zip subhook-2aca600fa7cf73fc9179b6ca24fbd399b6d91353.tar.gz subhook-2aca600fa7cf73fc9179b6ca24fbd399b6d91353.tar.bz2 |
Allocate whole struct in one malloc() call
Diffstat (limited to 'subhook.c')
-rw-r--r-- | subhook.c | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -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; } |