test/hash: free allocated memory
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Tue, 2 Jul 2019 00:27:23 +0000 (19:27 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 5 Jul 2019 08:45:07 +0000 (10:45 +0200)
Free allocated memory.

Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
app/test/test_hash_readwrite_lf.c

index c7fad58..dc4a52d 100644 (file)
@@ -535,6 +535,7 @@ generate_keys(void)
               tbl_rwc_test_param.count_keys_ks_extbkt);
 
        rte_free(found);
+       rte_free(scanned_bkts);
        rte_hash_free(tbl_rwc_test_param.h);
        return 0;
 
@@ -545,9 +546,11 @@ err:
        rte_free(keys_absent);
        rte_free(found);
        rte_free(tbl_rwc_test_param.keys_shift_path);
+       rte_free(keys_non_shift_path);
        rte_free(keys_ext_bkt);
        rte_free(keys_ks_extbkt);
        rte_free(scanned_bkts);
+       rte_hash_free(tbl_rwc_test_param.h);
        return -1;
 }
 
@@ -1429,7 +1432,9 @@ results:
        rte_free(tbl_rwc_test_param.keys_ks);
        rte_free(tbl_rwc_test_param.keys_absent);
        rte_free(tbl_rwc_test_param.keys_shift_path);
-       rte_free(scanned_bkts);
+       rte_free(tbl_rwc_test_param.keys_non_shift_path);
+       rte_free(tbl_rwc_test_param.keys_ext_bkt);
+       rte_free(tbl_rwc_test_param.keys_ks_extbkt);
        return 0;
 }