pajoye                                   Wed, 19 Jan 2011 15:23:07 +0000

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

Log:
- malloc may fail

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/gd/gdcache.c
    U   php/php-src/trunk/ext/gd/gdcache.c

Modified: php/php-src/branches/PHP_5_3/ext/gd/gdcache.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/gd/gdcache.c       2011-01-19 14:21:46 UTC 
(rev 307587)
+++ php/php-src/branches/PHP_5_3/ext/gd/gdcache.c       2011-01-19 15:23:07 UTC 
(rev 307588)
@@ -159,6 +159,9 @@
        key_value_t *map;

        map = (key_value_t *)malloc(sizeof(key_value_t));
+       if (map == NULL) {
+               return NULL;
+       }
        map->key = *(int *)key;
        map->value = 3;


Modified: php/php-src/trunk/ext/gd/gdcache.c
===================================================================
--- php/php-src/trunk/ext/gd/gdcache.c  2011-01-19 14:21:46 UTC (rev 307587)
+++ php/php-src/trunk/ext/gd/gdcache.c  2011-01-19 15:23:07 UTC (rev 307588)
@@ -159,6 +159,9 @@
        key_value_t *map;

        map = (key_value_t *)malloc(sizeof(key_value_t));
+       if (map == NULL) {
+               return NULL;
+       }
        map->key = *(int *)key;
        map->value = 3;


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

Reply via email to