Commit a6379f0a authored by Aditya Pakki's avatar Aditya Pakki Committed by David S. Miller

test_objagg: Fix potential memory leak in error handling

In case of failure of check_expect_hints_stats(), the resources
allocated by objagg_hints_get should be freed. The patch fixes
this issue.
Signed-off-by: default avatarAditya Pakki <pakki001@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent adaff6d9
...@@ -979,10 +979,10 @@ static int test_hints_case(const struct hints_case *hints_case) ...@@ -979,10 +979,10 @@ static int test_hints_case(const struct hints_case *hints_case)
err_world2_obj_get: err_world2_obj_get:
for (i--; i >= 0; i--) for (i--; i >= 0; i--)
world_obj_put(&world2, objagg, hints_case->key_ids[i]); world_obj_put(&world2, objagg, hints_case->key_ids[i]);
objagg_hints_put(hints);
objagg_destroy(objagg2);
i = hints_case->key_ids_count; i = hints_case->key_ids_count;
objagg_destroy(objagg2);
err_check_expect_hints_stats: err_check_expect_hints_stats:
objagg_hints_put(hints);
err_hints_get: err_hints_get:
err_check_expect_stats: err_check_expect_stats:
err_world_obj_get: err_world_obj_get:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment