mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qemu-io: Plug memory leak in open command
Introduced in commit b543c5c. Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
committed by
Kevin Wolf
parent
443422fde7
commit
29f2601aa6
@@ -54,6 +54,7 @@ static int openfile(char *name, int flags, int growable, QDict *opts)
|
||||
|
||||
if (qemuio_bs) {
|
||||
fprintf(stderr, "file open already, try 'help close'\n");
|
||||
QDECREF(opts);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -175,6 +176,7 @@ static int open_f(BlockDriverState *bs, int argc, char **argv)
|
||||
} else if (optind == argc) {
|
||||
return openfile(NULL, flags, growable, opts);
|
||||
} else {
|
||||
QDECREF(opts);
|
||||
return qemuio_command_usage(&open_cmd);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user