@@ -315,12 +315,11 @@ return; buckets = [self allocMemoryWithSize: sizeof(*buckets) count: capacity]; - for (i = 0; i < capacity; i++) - buckets[i] = NULL; + memset(buckets, 0, capacity * sizeof(*buckets)); for (i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deleted) { uint32_t j, last; @@ -382,11 +381,11 @@ if (_keyFunctions.equal(_buckets[i]->key, key)) break; } } - /* Key not in dictionary */ + /* Key not in map table */ if (i >= last || _buckets[i] == NULL || _buckets[i] == &deleted || !_keyFunctions.equal(_buckets[i]->key, key)) { struct of_map_table_bucket *bucket; [self OF_resizeForCount: _count + 1]; @@ -419,11 +418,11 @@ } @try { bucket->value = _valueFunctions.retain(value); } @catch (id e) { - _keyFunctions.release(key); + _keyFunctions.release(bucket->key); [self freeMemory: bucket]; @throw e; } bucket->hash = hash;