diff options
author | Aditya Pakki <pakki001@umn.edu> | 2020-06-12 23:01:54 +0300 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2020-06-30 22:37:04 +0300 |
commit | 8dba9173a37a53197971c39f752d07e6bc1a50d0 (patch) | |
tree | c950ad3c02eed1d2c5989236a4dc71549f4315c2 /lib | |
parent | 6fd916e249357a65a4924795613eb1bf69514209 (diff) | |
download | linux-8dba9173a37a53197971c39f752d07e6bc1a50d0.tar.xz |
test_objagg: Fix potential memory leak in error handling
[ Upstream commit a6379f0ad6375a707e915518ecd5c2270afcd395 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test_objagg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/test_objagg.c b/lib/test_objagg.c index 72c1abfa154d..da137939a410 100644 --- a/lib/test_objagg.c +++ b/lib/test_objagg.c @@ -979,10 +979,10 @@ err_check_expect_stats2: 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: |