- transform_attribute *attrs[cnt];
- CFStringRef names[cnt];
- CFDictionaryRef values[cnt];
+ transform_attribute **attrs = (transform_attribute**)malloc(cnt*sizeof(transform_attribute));
+ CFStringRef *names = (CFStringRef*)malloc(cnt*sizeof(CFStringRef));
+ CFDictionaryRef *values = (CFDictionaryRef*)malloc(sizeof(CFDictionaryRef) * cnt);
+
+ if (attrs == NULL || names == NULL || values == NULL) {
+ free(attrs);
+ free(names);
+ free(values);
+ return NULL;
+ }
+