You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2009/05/17 17:55:11 UTC

svn commit: r775681 - /apr/apr/trunk/hooks/apr_hooks.c

Author: trawick
Date: Sun May 17 15:55:11 2009
New Revision: 775681

URL: http://svn.apache.org/viewvc?rev=775681&view=rev
Log:
prevent crash if apr_hook_deregister_all() called but no hooks had been registered

Modified:
    apr/apr/trunk/hooks/apr_hooks.c

Modified: apr/apr/trunk/hooks/apr_hooks.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/hooks/apr_hooks.c?rev=775681&r1=775680&r2=775681&view=diff
==============================================================================
--- apr/apr/trunk/hooks/apr_hooks.c (original)
+++ apr/apr/trunk/hooks/apr_hooks.c Sun May 17 15:55:11 2009
@@ -265,6 +265,10 @@
 #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;