cvs: gd /libgd gdcache.c
| From: | Pierre-Alain Joye | Date: | Thu, 11 Jan 2007 02:24:00 +0000 |
| Subject: | cvs: gd /libgd gdcache.c | ||
| Groups: | php.gd.cvs | ||
| Request: | Send a blank email to php-gd-cvs+get-84@lists.php.net to get a copy of this message | ||
pajoye Thu Jan 11 02:24:00 2007 UTC
Modified files:
/gd/libgd gdcache.c
Log:
#14, another sanity check (catched by Takeshi (tabe[at]fixedpoint[dot]jp))
http://cvs.php.net/viewvc.cgi/gd/libgd/gdcache.c?r1=1.7&r2=1.8&diff_format=u
Index: gd/libgd/gdcache.c
diff -u gd/libgd/gdcache.c:1.7 gd/libgd/gdcache.c:1.8
--- gd/libgd/gdcache.c:1.7 Wed Jan 3 20:50:12 2007
+++ gd/libgd/gdcache.c Thu Jan 11 02:24:00 2007
@@ -134,6 +134,11 @@
if (i < head->size)
{ /* cache still growing - add new elem */
elem = (gdCache_element_t *) gdMalloc (sizeof (gdCache_element_t));
+ if (!elem)
+ {
+ (*(head->gdCacheRelease)) (userdata);
+ return NULL;
+ }
}
else
{ /* cache full - replace least-recently-used */