[libvirt PATCH] util: Fix memory leak when clearing Open vSwitch QoS

Jano Tomko jtomko at redhat.com
Mon Aug 16 07:08:18 UTC 2021


On a %A in %Y, Jiri Denemark wrote:
> No need to overwrite vmid_ex_id with a pointer to another copy of the
> same string when the original is still alive.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/util/virnetdevopenvswitch.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
> index 7a64a8dbe6..f6a8ed4a31 100644
> --- a/src/util/virnetdevopenvswitch.c
> +++ b/src/util/virnetdevopenvswitch.c
> @@ -824,7 +824,6 @@ virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
>      /* find queue */
>      virCommandFree(cmd);
>      cmd = virNetDevOpenvswitchCreateCmd();
> -    vmid_ex_id = g_strdup_printf("external-ids:vm-id=\"%s\"", vmuuidstr);
>      virCommandAddArgList(cmd, "--no-heading", "--columns=_uuid", "find", "queue", vmid_ex_id, NULL);
>      virCommandSetOutputBuffer(cmd, &queue_uuid);
>      if (virCommandRun(cmd, NULL) < 0) {
> 

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano




More information about the libvir-list mailing list