correct use of calloc in hashtable_t
authorTobias Brunner <tobias@strongswan.org>
Wed, 17 Dec 2008 09:56:05 +0000 (09:56 -0000)
committerTobias Brunner <tobias@strongswan.org>
Wed, 17 Dec 2008 09:56:05 +0000 (09:56 -0000)
src/libstrongswan/utils/hashtable.c

index 7428fd3..9c364dd 100644 (file)
@@ -169,8 +169,7 @@ static void init_hashtable(private_hashtable_t *this, u_int capacity)
        this->mask = this->capacity - 1;
        this->load_factor = 0.75;
        
-       this->table = (linked_list_t**)calloc(this->capacity, sizeof(linked_list_t*));
-       memset(this->table, 0, this->capacity * sizeof(linked_list_t*));
+       this->table = calloc(this->capacity, sizeof(linked_list_t*));
 }
 
 /**