Skip to content
Snippets Groups Projects
Commit 29f2601a authored by Markus Armbruster's avatar Markus Armbruster Committed by Kevin Wolf
Browse files

qemu-io: Plug memory leak in open command


Introduced in commit b543c5cd.  Spotted by Coverity.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 443422fd
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment