このリンクを参照してください。- とマークされた行を + とマークされた行に置き換えるだけです。
- if((array = [array init]) == NULL) { return(NULL); }
+ if([array init] == NULL) { free(array); return(NULL); }
- if(JK_EXPECT_F((array->objects = (id *)malloc(sizeof(id) * array->capacity)) == NULL)) { [array autorelease]; return(NULL); }
+ if(JK_EXPECT_F((array->objects = (id *)malloc(sizeof(id) * array->capacity)) == NULL)) { free(array); return(NULL); }
- if((dictionary = [dictionary init]) == NULL) { return(NULL); }
+ if([dictionary init] == NULL) { free(dictionary);return(NULL); }
- if(JK_EXPECT_F((dictionary->entry = (JKHashTableEntry *)calloc(1UL, sizeof(JKHashTableEntry) * dictionary->capacity)) == NULL)) { [dictionary autorelease]; return(NULL); }
+ if(JK_EXPECT_F((dictionary->entry = (JKHashTableEntry *)calloc(1UL, sizeof(JKHashTableEntry) * dictionary->capacity)) == NULL)) { free(dictionary); return(NULL); }