Skip to content

Commit

Permalink
test_objagg: Fix potential memory leak in error handling
Browse files Browse the repository at this point in the history
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: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Aditya Pakki authored and David S. Miller committed Jun 15, 2020
1 parent adaff6d commit a6379f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/test_objagg.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,10 @@ static int test_hints_case(const struct hints_case *hints_case)
err_world2_obj_get:
for (i--; i >= 0; i--)
world_obj_put(&world2, objagg, hints_case->key_ids[i]);
objagg_hints_put(hints);
objagg_destroy(objagg2);
i = hints_case->key_ids_count;
objagg_destroy(objagg2);
err_check_expect_hints_stats:
objagg_hints_put(hints);
err_hints_get:
err_check_expect_stats:
err_world_obj_get:
Expand Down

0 comments on commit a6379f0

Please sign in to comment.