]> granicus.if.org Git - php/commitdiff
MFH:
authorAndrey Hristov <andrey@php.net>
Thu, 11 Jun 2009 08:52:06 +0000 (08:52 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 11 Jun 2009 08:52:06 +0000 (08:52 +0000)
Protect the code when variable is NULL, which should never happen, but
anyway, you know about "never happens" :)

ext/mysqlnd/mysqlnd_block_alloc.c

index 2dcedcbfe65ef1eccd465731dad2557f175ce41b..4943624f47a6e541ce05115e12547401f465de8e 100644 (file)
@@ -183,10 +183,12 @@ void
 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;
 }
 /* }}} */