SecTransformAttributeRef search_for = pthread_getspecific(ah_search_key_slot);
if (!search_for)
{
- search_for = makeAH((transform_attribute*)malloc(sizeof(transform_attribute)));
+ transform_attribute* ta = (transform_attribute*)malloc(sizeof(transform_attribute));
+ search_for = makeAH(ta);
if (!search_for)
{
+ free(ta);
return NULL;
}
ah = makeAH(ta);
if (!ah)
{
+ free(ta);
return NULL;
}
ta->name = CFStringCreateCopy(NULL, label);
if (!ta->name)
{
+ CFRelease(ah);
free(ta);
return NULL;
}
{
CFReleaseNull(ta->name);
free(ta);
+ CFRelease(ah);
return NULL;
}
{
// make an array big enough to hold all of the attributes
CFIndex numAttributes = CFSetGetCount(mAttributes);
- transform_attribute **attributes = (transform_attribute**)malloc(numAttributes*sizeof(transform_attribute));
+ transform_attribute **attributes = (transform_attribute**)malloc(numAttributes*sizeof(transform_attribute*));
if (attributes == NULL) {
// No more memory, we assume it's orphaned
{
// make an array big enough to hold all of the attributes
CFIndex numAttributes = CFSetGetCount(mAttributes);
- transform_attribute **attributes = (transform_attribute**)malloc(numAttributes*sizeof(transform_attribute));
+ transform_attribute **attributes = (transform_attribute**)malloc(numAttributes*sizeof(transform_attribute*));
if (attributes == NULL) {
// No more memory, we assume it's orphaned
CFDictionaryRef Transform::CopyState()
{
CFIndex i, j, cnt = CFSetGetCount(mAttributes);
- transform_attribute **attrs = (transform_attribute**)malloc(cnt*sizeof(transform_attribute));
+ transform_attribute **attrs = (transform_attribute**)malloc(cnt*sizeof(transform_attribute*));
CFStringRef *names = (CFStringRef*)malloc(cnt*sizeof(CFStringRef));
CFDictionaryRef *values = (CFDictionaryRef*)malloc(sizeof(CFDictionaryRef) * cnt);
// now walk the attribute list
CFIndex numAttributes = CFSetGetCount(mAttributes);
- transform_attribute **attributes = (transform_attribute**)malloc(numAttributes*sizeof(transform_attribute));
+ transform_attribute **attributes = (transform_attribute**)malloc(numAttributes*sizeof(transform_attribute*));
if (attributes == NULL) {
return GetNoMemoryErrorAndRetain();