From 108247eb5d1f539207892afda48e2e83dc77d991 Mon Sep 17 00:00:00 2001 From: theraven Date: Thu, 9 Sep 2010 10:19:09 +0000 Subject: [PATCH] Fix dead store (the only bug found by the clang static analyser). --- runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime.c b/runtime.c index f014902..e49fb1d 100644 --- a/runtime.c +++ b/runtime.c @@ -139,8 +139,8 @@ BOOL class_addMethod(Class cls, SEL name, IMP imp, const char *types) BOOL class_addProtocol(Class cls, Protocol *protocol) { if (class_conformsToProtocol(cls, protocol)) { return NO; } - struct objc_protocol_list *protocols = cls->protocols; - protocols = malloc(sizeof(struct objc_protocol_list)); + struct objc_protocol_list *protocols = + malloc(sizeof(struct objc_protocol_list)); if (protocols == NULL) { return NO; } protocols->next = cls->protocols; protocols->count = 1;