pajoye                                   Thu, 28 Jul 2011 21:16:51 +0000

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

Log:
- Fix #55301 (sybase part, take #2) check if malloc succeded

Bugs: https://bugs.php.net/55301 (Open) multiple null pointer
      https://bugs.php.net/2 (Closed) hash_environment
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c
    U   php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c
    U   php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c

Modified: php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c  2011-07-28 
20:16:09 UTC (rev 313902)
+++ php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c  2011-07-28 
21:16:51 UTC (rev 313903)
@@ -777,7 +777,7 @@
                        }

                        sybase_ptr = (sybase_link *) 
malloc(sizeof(sybase_link));
-                       if (sybase_ptr) {
+                       if (!sybase_ptr) {
                                efree(hashed_details);
                                RETURN_FALSE;
                        }

Modified: php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c  2011-07-28 
20:16:09 UTC (rev 313902)
+++ php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c  2011-07-28 
21:16:51 UTC (rev 313903)
@@ -777,7 +777,7 @@
                        }

                        sybase_ptr = (sybase_link *) 
malloc(sizeof(sybase_link));
-                       if (sybase_ptr) {
+                       if (!sybase_ptr) {
                                efree(hashed_details);
                                RETURN_FALSE;
                        }

Modified: php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c
===================================================================
--- php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c     2011-07-28 20:16:09 UTC 
(rev 313902)
+++ php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c     2011-07-28 21:16:51 UTC 
(rev 313903)
@@ -777,7 +777,7 @@
                        }

                        sybase_ptr = (sybase_link *) 
malloc(sizeof(sybase_link));
-                       if (sybase_ptr) {
+                       if (!sybase_ptr) {
                                efree(hashed_details);
                                RETURN_FALSE;
                        }

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

Reply via email to