mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
util/uri: do not check argument of uri_free()
uri_free() checks if its argument is NULL in uri_clean() and g_free(). There is no need to check the argument before the call. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Message-Id: <20210629063602.4239-1-xypron.glpk@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
eb06cbab7e
commit
c2615bdfbd
3 changed files with 8 additions and 22 deletions
|
@ -147,9 +147,7 @@ out:
|
|||
if (qp) {
|
||||
query_params_free(qp);
|
||||
}
|
||||
if (uri) {
|
||||
uri_free(uri);
|
||||
}
|
||||
uri_free(uri);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -237,9 +237,7 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
|
|||
return 0;
|
||||
|
||||
err:
|
||||
if (uri) {
|
||||
uri_free(uri);
|
||||
}
|
||||
uri_free(uri);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue