andrey Mon, 31 May 2010 17:09:13 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=299996
Log: Bail if allocation fails Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_loaddata.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_loaddata.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_loaddata.c 2010-05-31 16:53:33 UTC (rev 299995) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_loaddata.c 2010-05-31 17:09:13 UTC (rev 299996) @@ -53,7 +53,12 @@ DBG_ENTER("mysqlnd_local_infile_init"); - *ptr = info = ((MYSQLND_INFILE_INFO *)mnd_ecalloc(1, sizeof(MYSQLND_INFILE_INFO))); + info = ((MYSQLND_INFILE_INFO *)mnd_ecalloc(1, sizeof(MYSQLND_INFILE_INFO))); + if (!info) { + DBG_RETURN(1); + } + + *ptr = info; /* check open_basedir */ if (PG(open_basedir)) { Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c =================================================================== --- php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c 2010-05-31 16:53:33 UTC (rev 299995) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c 2010-05-31 17:09:13 UTC (rev 299996) @@ -53,7 +53,12 @@ DBG_ENTER("mysqlnd_local_infile_init"); - *ptr = info = ((MYSQLND_INFILE_INFO *)mnd_ecalloc(1, sizeof(MYSQLND_INFILE_INFO))); + info = ((MYSQLND_INFILE_INFO *)mnd_ecalloc(1, sizeof(MYSQLND_INFILE_INFO))); + if (!info) { + DBG_RETURN(1); + } + + *ptr = info; /* check open_basedir */ if (PG(open_basedir)) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php