summaryrefslogtreecommitdiff
path: root/hooks/apr_hooks.c
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2009-05-17 15:55:11 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2009-05-17 15:55:11 +0000
commit44482ce76d6a815efb810ea3fcc821a58442052b (patch)
tree1a64287677d05f49254e5486321a82912986ebc9 /hooks/apr_hooks.c
parentf555c0762ae54f20214ae7f79825745d9ee6062d (diff)
downloadlibapr-44482ce76d6a815efb810ea3fcc821a58442052b.tar.gz
prevent crash if apr_hook_deregister_all() called but no hooks had been registered
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@775681 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'hooks/apr_hooks.c')
-rw-r--r--hooks/apr_hooks.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c
index d8eb82d23..6abe19356 100644
--- a/hooks/apr_hooks.c
+++ b/hooks/apr_hooks.c
@@ -265,6 +265,10 @@ APU_DECLARE(void) apr_hook_deregister_all(void)
#endif
int n;
+ if (!s_aHooksToSort) {
+ return;
+ }
+
for(n=0 ; n < s_aHooksToSort->nelts ; ++n) {
HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n];
*pEntry->paHooks=NULL;