cvs: gd /libgd gdcache.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1168482240@cvsserver>
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 */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.