aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMaxim Levitsky <mlevitsk@redhat.com>2020-12-17 19:09:02 +0200
committerKevin Wolf <kwolf@redhat.com>2021-02-15 15:10:14 +0100
commitdcb6699512b6235eac383fc84e8e27302e08d7e3 (patch)
tree907bf69a55d3d82157cb3a037d6446ecf31d60bc /block
parentf8b467b443fb3e1c531e0a8b3201104277401ee5 (diff)
crypto: luks: Fix tiny memory leak
When the underlying block device doesn't support the bdrv_co_delete_file interface, an 'Error' object was leaked. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20201217170904.946013-2-mlevitsk@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/crypto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/crypto.c b/block/crypto.c
index aef5a5721a..b3a5275132 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -735,6 +735,8 @@ fail:
*/
if ((r_del < 0) && (r_del != -ENOTSUP)) {
error_report_err(local_delete_err);
+ } else {
+ error_free(local_delete_err);
}
}