mirror of
https://github.com/nickshanks/ResKnife.git
synced 2025-04-18 22:41:58 +00:00
Plug more leaks; don't call malloc() with zero size.
This commit is contained in:
parent
76281dd506
commit
ed032720a8
@ -63,6 +63,10 @@
|
||||
if(length < _minLength) length = _minLength;
|
||||
|
||||
// read string
|
||||
|
||||
if (length == 0)
|
||||
return;
|
||||
|
||||
void *buffer = malloc(length);
|
||||
if(_minLength) memset(buffer, 0, _minLength);
|
||||
[stream readAmount:length toBuffer:buffer];
|
||||
|
@ -219,7 +219,7 @@
|
||||
|
||||
- (void)revertResource:(id)sender
|
||||
{
|
||||
[resource setData:[[backup data] copy]];
|
||||
[resource setData:[[[backup data] copy] autorelease]];
|
||||
}
|
||||
|
||||
- (void)readTemplate:(id<ResKnifeResourceProtocol>)tmplRes
|
||||
|
Loading…
x
Reference in New Issue
Block a user