Re: [PATCH] qemu_agent.c: Use g_autofree in qemu_agent.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26. 3. 2020 14:14, Seeteena Thoufeek wrote:
> This is the only instance of g_autofree change applicable for
> qemu_agent.c
> 
> Signed-off-by: Seeteena Thoufeek <s1seetee@xxxxxxxxxxxxxxxxxx>
> ---
>  src/qemu/qemu_agent.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
> index 95a7d9b..c74bd0e 100644
> --- a/src/qemu/qemu_agent.c
> +++ b/src/qemu/qemu_agent.c
> @@ -1083,7 +1083,7 @@ qemuAgentCommandFull(qemuAgentPtr agent,
>  {
>      int ret = -1;
>      qemuAgentMessage msg;
> -    char *cmdstr = NULL;
> +    g_autofree char *cmdstr = NULL;
>      int await_event = agent->await_event;
>  
>      *reply = NULL;
> @@ -1133,7 +1133,6 @@ qemuAgentCommandFull(qemuAgentPtr agent,
>      ret = qemuAgentCheckError(cmd, *reply, report_unsupported);
>  
>   cleanup:
> -    VIR_FREE(cmdstr);
>      VIR_FREE(msg.txBuffer);
>      agent->await_event = QEMU_AGENT_EVENT_NONE;
>  
> 

Hey, there are some more places that could use the same treatment.
Namely str1 in qemuAgentIOProcessData() and str1 and str2 in
qemuAgentIOProcess(). Do you mind sending a v2 which fixes them too?

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux