Skip to content

Commit

Permalink
parallels: fix memory leak in parallels_open()
Browse files Browse the repository at this point in the history
We should free opts allocated through qemu_opts_create() at the end.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
  • Loading branch information
Denis V. Lunev committed Sep 21, 2023
1 parent 73f3e13 commit c74cd7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/parallels.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
fail_options:
ret = -EINVAL;
fail:
qemu_opts_del(opts);
/*
* "s" object was allocated by g_malloc0 so we can safely
* try to free its fields even they were not allocated.
Expand Down

0 comments on commit c74cd7b

Please sign in to comment.