You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intention is that the memory is freed when the NSData object is released. But this happens only later, outside of the while loop. So when processing a large RAR archive, this while loop eats up the RAM.
Suggestion: Use realloc instead of malloc, do not give the NSData object ownership of the memory, and call free(buffer) when the loop is done.
The text was updated successfully, but these errors were encountered:
Within the while loop in performOnDataInArchive, a buffer is allocated with malloc and used for an NSData object:
NSData *data = [NSData dataWithBytesNoCopy:buffer length:(NSUInteger)info.uncompressedSize freeWhenDone:YES];
The intention is that the memory is freed when the NSData object is released. But this happens only later, outside of the while loop. So when processing a large RAR archive, this while loop eats up the RAM.
Suggestion: Use realloc instead of malloc, do not give the NSData object ownership of the memory, and call free(buffer) when the loop is done.
The text was updated successfully, but these errors were encountered: