andrey          Thu Jun 11 08:51:20 2009 UTC

  Modified files:              
    /php-src/ext/mysqlnd        mysqlnd_block_alloc.c 
  Log:
  Protect the code when variable is NULL, which should never happen, but
  anyway, you know about "never happens"
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_block_alloc.c?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_block_alloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.8 
php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.9
--- php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.8       Wed Dec 31 11:12:33 2008
+++ php-src/ext/mysqlnd/mysqlnd_block_alloc.c   Thu Jun 11 08:51:20 2009
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_block_alloc.c,v 1.8 2008/12/31 11:12:33 sebastian Exp $ */
+/* $Id: mysqlnd_block_alloc.c,v 1.9 2009/06/11 08:51:20 andrey Exp $ */
 
 #include "php.h"
 #include "mysqlnd.h"
@@ -183,10 +183,12 @@
 mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
 {
        DBG_ENTER("mysqlnd_mempool_destroy");
-       /* mnd_free will reference LOCK_access and might crash, depending on 
the caller...*/
-       mysqlnd_mempool_free_contents(pool TSRMLS_CC);
-       mnd_free(pool->arena);
-       mnd_free(pool);
+       if (pool) {
+               /* mnd_free will reference LOCK_access and might crash, 
depending on the caller...*/
+               mysqlnd_mempool_free_contents(pool TSRMLS_CC);
+               mnd_free(pool->arena);
+               mnd_free(pool);
+       }
        DBG_VOID_RETURN;
 }
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to