Fix dead store (the only bug found by the clang static analyser).

main
theraven 16 years ago
parent f43e7f6845
commit 108247eb5d

@ -139,8 +139,8 @@ BOOL class_addMethod(Class cls, SEL name, IMP imp, const char *types)
BOOL class_addProtocol(Class cls, Protocol *protocol) BOOL class_addProtocol(Class cls, Protocol *protocol)
{ {
if (class_conformsToProtocol(cls, protocol)) { return NO; } if (class_conformsToProtocol(cls, protocol)) { return NO; }
struct objc_protocol_list *protocols = cls->protocols; struct objc_protocol_list *protocols =
protocols = malloc(sizeof(struct objc_protocol_list)); malloc(sizeof(struct objc_protocol_list));
if (protocols == NULL) { return NO; } if (protocols == NULL) { return NO; }
protocols->next = cls->protocols; protocols->next = cls->protocols;
protocols->count = 1; protocols->count = 1;

Loading…
Cancel
Save