andrey                                   Mon, 03 May 2010 14:26:08 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=298904

Log:
One more case to handle in case of OOM, in block_alloc_resize_chunk

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c      
2010-05-03 14:16:04 UTC (rev 298903)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c      
2010-05-03 14:26:08 UTC (rev 298904)
@@ -99,7 +99,12 @@
                        }
                }
        } else {
-               chunk->ptr = mnd_realloc(chunk->ptr, size);
+               zend_uchar *new_ptr = mnd_realloc(chunk->ptr, size);
+               if (!new_ptr) {
+                       DBG_RETURN(FAIL);
+               }
+               chunk->ptr = new_ptr;
+
        }
        DBG_RETURN(PASS);
 }

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c 2010-05-03 14:16:04 UTC 
(rev 298903)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c 2010-05-03 14:26:08 UTC 
(rev 298904)
@@ -99,7 +99,12 @@
                        }
                }
        } else {
-               chunk->ptr = mnd_realloc(chunk->ptr, size);
+               zend_uchar *new_ptr = mnd_realloc(chunk->ptr, size);
+               if (!new_ptr) {
+                       DBG_RETURN(FAIL);
+               }
+               chunk->ptr = new_ptr;
+
        }
        DBG_RETURN(PASS);
 }

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

Reply via email to