mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Use NSZoneMalloc and NSZoneRealloc for memory used by data, so it is in the correct zone for the instance (and to avoid complaints from static analyser).
This commit is contained in:
parent
dca9b65313
commit
fe7d9b6435
1 changed files with 3 additions and 2 deletions
|
@ -695,6 +695,7 @@ failure:
|
|||
unsigned char *dst;
|
||||
unsigned char buf[4];
|
||||
unsigned pos = 0;
|
||||
NSZone *zone = [self zone];
|
||||
|
||||
if (nil == base64Data)
|
||||
{
|
||||
|
@ -713,7 +714,7 @@ failure:
|
|||
src = (const unsigned char*)[base64Data bytes];
|
||||
end = &src[length];
|
||||
|
||||
result = (unsigned char*)malloc(declen);
|
||||
result = NSZoneMalloc(zone, declen);
|
||||
dst = result;
|
||||
|
||||
while (src != end)
|
||||
|
@ -818,7 +819,7 @@ failure:
|
|||
*/
|
||||
if ((((declen - length) * 100) / declen) > 5)
|
||||
{
|
||||
result = realloc(result, length);
|
||||
result = NSZoneRealloc(zone, result, length);
|
||||
}
|
||||
}
|
||||
return [self initWithBytesNoCopy: result length: length freeWhenDone: YES];
|
||||
|
|
Loading…
Reference in a new issue