[libvirt] [PATCH v1 17/18] use VIR_AUTOFREE in src/util/virfirewall.c

Erik Skultety eskultet at redhat.com
Tue Jun 5 15:01:56 UTC 2018


On Sun, Jun 03, 2018 at 01:42:15PM +0530, Sukrit Bhatnagar wrote:
> Modify code to use VIR_AUTOFREE macro wherever required.
>
> Signed-off-by: Sukrit Bhatnagar <skrtbhtngr at gmail.com>
> ---
>  src/util/virfirewall.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

...

> @@ -808,12 +805,11 @@ virFirewallApplyRule(virFirewallPtr firewall,
>                       virFirewallRulePtr rule,
>                       bool ignoreErrors)
>  {
> -    char *output = NULL;
> +    VIR_AUTOFREE(char *) output = NULL;
>      char **lines = NULL;
>      int ret = -1;
> -    char *str = virFirewallRuleToString(rule);
> +    VIR_AUTOFREE(char *) str = virFirewallRuleToString(rule);

let's couple ^this VIR_AUTOFREE with the one above...

Erik




More information about the libvir-list mailing list