Fix incorrect malloc size.

main
theraven 14 years ago
parent 02fe58d85a
commit 3c8407c41d

@ -464,7 +464,8 @@ BOOL class_addProperty(Class cls,
// If there is a name mismatch, the attributes are invalid. // If there is a name mismatch, the attributes are invalid.
if ((p.name != 0) && (strcmp(name, p.name) != 0)) { return NO; } if ((p.name != 0) && (strcmp(name, p.name) != 0)) { return NO; }
struct objc_property_list *l = calloc(1, sizeof(struct objc_property_list)); struct objc_property_list *l = calloc(1, sizeof(struct objc_property_list)
+ sizeof(struct objc_property));
l->count = 0; l->count = 0;
memcpy(&l->properties, &p, sizeof(struct objc_property)); memcpy(&l->properties, &p, sizeof(struct objc_property));
LOCK_RUNTIME_FOR_SCOPE(); LOCK_RUNTIME_FOR_SCOPE();

Loading…
Cancel
Save