diff options
author | Andrey Hristov <andrey@php.net> | 2009-06-11 08:52:06 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2009-06-11 08:52:06 +0000 |
commit | 28c8d25dca97d0316458c86509301e948994f3db (patch) | |
tree | 1c53dea7cbe0d72f5608a35c27b803621dd1d94b /ext/mysqlnd/mysqlnd_block_alloc.c | |
parent | cff09ba5dfb363be6f824de6c002d5de68574990 (diff) | |
download | php-git-28c8d25dca97d0316458c86509301e948994f3db.tar.gz |
MFH:
Protect the code when variable is NULL, which should never happen, but
anyway, you know about "never happens" :)
Diffstat (limited to 'ext/mysqlnd/mysqlnd_block_alloc.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_block_alloc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c index 2dcedcbfe6..4943624f47 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.c +++ b/ext/mysqlnd/mysqlnd_block_alloc.c @@ -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; } /* }}} */ |