diff options
author | Zeex <zeex@rocketmail.com> | 2017-03-31 22:32:15 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 22:32:15 +0600 |
commit | 699a6bd35710f075e3b94d27616d270046b09d3d (patch) | |
tree | 6771f88243e34ca3435bee02da044c7ab5183bf7 /subhook.h | |
parent | 2f9d0c1f1cfb3366c189b8bd52a5e8c266d96e8a (diff) | |
parent | 1edbc7246cd65a9a0f4c7ecd9e7e306952fe67b2 (diff) | |
download | subhook-699a6bd35710f075e3b94d27616d270046b09d3d.zip subhook-699a6bd35710f075e3b94d27616d270046b09d3d.tar.gz subhook-699a6bd35710f075e3b94d27616d270046b09d3d.tar.bz2 |
Merge pull request #23 from gocha/fix-dtor-nullref
Fix null reference on the destruction of empty Hook
Diffstat (limited to 'subhook.h')
-rw-r--r-- | subhook.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -145,8 +145,10 @@ class Hook { : hook_(subhook_new(src, dst, (subhook_options_t)options)) {} ~Hook() { - subhook_remove(hook_); - subhook_free(hook_); + if (hook_ != 0) { + subhook_remove(hook_); + subhook_free(hook_); + } } void *GetSrc() { return subhook_get_src(hook_); } |