------------------------------------------------------------ revno: 5566 committer: Diego Biurrun <diego@xxxxxxxxxx> branch nick: malloc timestamp: Wed 2011-01-12 20:44:55 +0100 message: Do not manually zero all members of anchor_db on uninit. modified: hipd/esp_prot_anchordb.c -- lp:hipl https://code.launchpad.net/~hipl-core/hipl/trunk Your team HIPL core team is subscribed to branch lp:hipl. To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'hipd/esp_prot_anchordb.c' --- hipd/esp_prot_anchordb.c 2011-01-10 12:00:38 +0000 +++ hipd/esp_prot_anchordb.c 2011-01-12 19:44:55 +0000 @@ -81,19 +81,7 @@ /** uninits the anchorDB */ void anchor_db_uninit(void) { - int i, j; - - // free all hashes - for (i = 0; i < MAX_NUM_TRANSFORMS; i++) { - anchor_db.num_anchors[i] = 0; - anchor_db.anchor_lengths[i] = 0; - anchor_db.hash_item_length[i] = 0; - - for (j = 0; j < HCSTORE_MAX_HCHAINS_PER_ITEM; j++) { - free(anchor_db.anchors[i][j]); - anchor_db.anchors[i][j] = NULL; - } - } + memset(&anchor_db, 0, sizeof(struct anchor_db)); HIP_DEBUG("uninited hchain anchorDB\n"); }