[libvirt] [PATCH 6/9] qemu: command: use VIR_AUTOFREE in qemuBuildFSDevCommandLine

Peter Krempa pkrempa at redhat.com
Tue Jul 16 13:46:38 UTC 2019


On Tue, Jul 16, 2019 at 13:06:54 +0200, Ján Tomko wrote:
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>  src/qemu/qemu_command.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 02a6642207..8617b010dc 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -2807,7 +2807,7 @@ qemuBuildFSDevCommandLine(virCommandPtr cmd,
>                            const virDomainDef *def,
>                            virQEMUCapsPtr qemuCaps)
>  {
> -    char *optstr;
> +    VIR_AUTOFREE(char *) optstr = NULL;

'optstr' is used twice in this function. If you want to convert to
VIR_AUTOFREE, introduce two variables for the two distinct uses.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190716/d8361fe1/attachment-0001.sig>


More information about the libvir-list mailing list