I noticed that there is another memory leak about freeing the memory allocated by ExceptionInfo. When image->exception is thrown, the following DestroyExceptionInfo will not be executed, thus lead to the leak. I've checked the src code of 6.2.8 and this is right there. Should be you guys' typo.
Code: Select all
Index: Image.cpp
===================================================================
--- Image.cpp (revision 9453)
+++ Image.cpp (working copy)
@@ -1603,9 +1603,9 @@
}
replaceImage( image );
throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
if ( image )
throwException( image->exception );
- (void) DestroyExceptionInfo( &exceptionInfo );
}
// Read image of specified size into current object
@@ -1627,9 +1627,9 @@
blob_.length(), &exceptionInfo );
replaceImage( image );
throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
if ( image )
throwException( image->exception );
- (void) DestroyExceptionInfo( &exceptionInfo );
}
// Read image of specified size from in-memory BLOB
@@ -1702,9 +1702,9 @@
&exceptionInfo );
replaceImage( image );
throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
if ( image )
throwException( image->exception );
- (void) DestroyExceptionInfo( &exceptionInfo );
}
Code: Select all
Index: coders/jpeg.c + 638
profile=BlobToStringInfo((const void *) NULL,length);
if (profile == (StringInfo *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
p=GetStringInfoDatum(profile);
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
*p++=(unsigned char) GetCharacter(jpeg_info);