backport memory initialisation fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@24743 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-03-01 17:42:46 +00:00
parent 6c08f6b082
commit 1817234997
9 changed files with 20 additions and 11 deletions

View file

@ -1,3 +1,15 @@
2007-03-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURLCredential.m:
* Source/NSURLAuthenticationChallenge.m:
* Source/NSURLCredentialStorage.m:
* Source/NSURLResponse.m:
* Source/NSURLProtocol.m:
* Source/NSURLCache.m:
* Source/NSURLProtectionSpace.m:
* Source/NSURLRequest.m:
backport memory initialisation fix from trunk
2007-02-14 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSDebug.m:

View file

@ -46,7 +46,7 @@ typedef struct {
if (o != nil)
{
o->_NSURLAuthenticationChallengeInternal
= NSZoneMalloc(z, sizeof(Internal));
= NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}

View file

@ -51,8 +51,7 @@ static NSURLCache *shared = nil;
if (o != nil)
{
o->_NSURLCacheInternal = NSZoneMalloc(z, sizeof(Internal));
memset(o->_NSURLCacheInternal, '\0', sizeof(Internal));
o->_NSURLCacheInternal = NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}

View file

@ -42,7 +42,7 @@ typedef struct {
if (o != nil)
{
o->_NSURLCredentialInternal = NSZoneMalloc(z, sizeof(Internal));
o->_NSURLCredentialInternal = NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}

View file

@ -56,7 +56,7 @@ static NSURLCredentialStorage *storage = nil;
o = (NSURLCredentialStorage*)
NSAllocateObject(self, 0, NSDefaultMallocZone());
o->_NSURLCredentialStorageInternal = (Internal*)
NSZoneMalloc(NSDefaultMallocZone(), sizeof(Internal));
NSZoneCalloc(NSDefaultMallocZone(), 1, sizeof(Internal));
((Internal*)(o->_NSURLCredentialStorageInternal))->credentials
= [NSMutableDictionary new];
((Internal*)(o->_NSURLCredentialStorageInternal))->defaults

View file

@ -62,7 +62,7 @@ typedef struct {
if (o != nil)
{
o->_NSURLProtectionSpaceInternal = NSZoneMalloc(z, sizeof(Internal));
o->_NSURLProtectionSpaceInternal = NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}

View file

@ -51,7 +51,7 @@ static NSLock *regLock = nil;
if (o != nil)
{
o->_NSURLProtocolInternal = NSZoneMalloc(z, sizeof(Internal));
o->_NSURLProtocolInternal = NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}

View file

@ -60,8 +60,7 @@ typedef struct {
if (o != nil)
{
o->_NSURLRequestInternal = NSZoneMalloc(z, sizeof(Internal));
memset(o->_NSURLRequestInternal, '\0', sizeof(Internal));
o->_NSURLRequestInternal = NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}

View file

@ -126,8 +126,7 @@ static const NSMapTableKeyCallBacks headerKeyCallBacks =
if (o != nil)
{
o->_NSURLResponseInternal = NSZoneMalloc(z, sizeof(Internal));
memset(o->_NSURLResponseInternal, '\0', sizeof(Internal));
o->_NSURLResponseInternal = NSZoneCalloc(z, 1, sizeof(Internal));
}
return o;
}