]> granicus.if.org Git - php/commitdiff
fixed a memleak.
authorfoobar <sniper@php.net>
Sat, 4 Aug 2001 03:06:12 +0000 (03:06 +0000)
committerfoobar <sniper@php.net>
Sat, 4 Aug 2001 03:06:12 +0000 (03:06 +0000)
ext/exif/exif.c

index 4469e43d7065ba22e7740a0542d00a4630bdb552..7abb061cf6f346c4f131b997c248ba5e8b3cf0e8 100644 (file)
@@ -934,7 +934,7 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *
                     fseek(infile, cp, SEEK_SET);
 
                     size = ep-cp;
-                    Data = (uchar *)malloc(size);
+                    Data = (uchar *)emalloc(size);
                     if (Data == NULL) {
                         php_error(E_WARNING,"could not allocate data for entire image");
                                                return FALSE;
@@ -953,6 +953,7 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *
                                        /*
                     *HaveAll = 1;
                                        */
+                                       efree(Data);
                 }
                 return TRUE;