cvs: gd /libgd/src gd_tga.c

From: Date: Tue, 16 Oct 2007 21:59:16 +0000
Subject: cvs: gd /libgd/src gd_tga.c
Groups: php.gd.cvs 
Request: Send a blank email to php-gd-cvs+get-317@lists.php.net to get a copy of this message
mattias Tue Oct 16 21:59:16 2007 UTC Modified files: /gd/libgd/src gd_tga.c Log: - Avoid unnessessary alloc http://cvs.php.net/viewvc.cgi/gd/libgd/src/gd_tga.c?r1=1.5&r2=1.6&diff_format=u Index: gd/libgd/src/gd_tga.c diff -u gd/libgd/src/gd_tga.c:1.5 gd/libgd/src/gd_tga.c:1.6 --- gd/libgd/src/gd_tga.c:1.5 Tue Oct 16 21:51:42 2007 +++ gd/libgd/src/gd_tga.c Tue Oct 16 21:59:16 2007 @@ -166,12 +166,14 @@ break; } - tga->ident = (char *) gdMalloc(tga->identsize * sizeof( char )); - if (tga->ident == NULL) { - return -1; - } + tga->ident = NULL; if (tga->identsize > 0) { + tga->ident = (char *) gdMalloc(tga->identsize * sizeof(char)); + if(tga->ident == NULL) { + return -1; + } + gdGetBuf( &( tga->ident ), tga->identsize, ctx ); }

« previous php.gd.cvs (#317) next »