Re: [PATCH 4/6] qemu_driver: use VIR_AUTOFREE() with strings 1/3

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

 



On Wed, Sep 18, 2019 at 11:56:56AM -0300, Daniel Henrique Barboza wrote:
> VIR_AUTOFREE is a beautiful macro. Let's use it across the board
> inside qemu_driver.c to make the code a bit tidier and smaller,
> sparing VIR_FREE() calls and sometimes a whole 'cleanup'
> label.
>
> This is a huge change due to the amount of char * declared in
> this file, thus let's split it in 3. This is the first part.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
> ---
...

> @@ -3000,7 +2978,7 @@ virQEMUSaveDataWrite(virQEMUSaveDataPtr data,
>      size_t cookie_len = 0;
>      int ret = -1;
>      size_t zerosLen = 0;
> -    char *zeros = NULL;
> +    VIR_AUTOFREE(char *) zeros = NULL;
>
>      xml_len = strlen(data->xml) + 1;
>      if (data->cookie)
> @@ -3057,7 +3035,6 @@ virQEMUSaveDataWrite(virQEMUSaveDataPtr data,
>      ret = 0;
>
>   cleanup:

^This cleanup can be dropped.

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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