qemu-img: Free option parameter lists in img_create()

Free option parameter lists in the img_create() error return path.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2010-12-07 09:35:55 +00:00 committed by Kevin Wolf
parent 0e72e753c2
commit a87a6721db

View File

@ -428,8 +428,6 @@ static int img_create(int argc, char **argv)
puts("");
ret = bdrv_create(drv, filename, param);
free_option_parameters(create_options);
free_option_parameters(param);
if (ret < 0) {
if (ret == -ENOTSUP) {
@ -441,6 +439,8 @@ static int img_create(int argc, char **argv)
}
}
out:
free_option_parameters(create_options);
free_option_parameters(param);
if (ret) {
return 1;
}