[PATCH 06/13] virfirewalld: Drop useless memset() in virFirewallDApplyRule()

Michal Privoznik posted 13 patches 2 years, 6 months ago
[PATCH 06/13] virfirewalld: Drop useless memset() in virFirewallDApplyRule()
Posted by Michal Privoznik 2 years, 6 months ago
This is a residue of v6.8.0-rc1~100. The error variable inside of
virFirewallDApplyRule() is already initialized to NULL. There's
no need to memset() it to zero again.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/util/virfirewalld.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c
index 6fc54f357d..827e201dbb 100644
--- a/src/util/virfirewalld.c
+++ b/src/util/virfirewalld.c
@@ -360,8 +360,6 @@ virFirewallDApplyRule(virFirewallLayer layer,
     if (!sysbus)
         return -1;
 
-    memset(&error, 0, sizeof(error));
-
     if (!ipv) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unknown firewall layer %1$d"),
-- 
2.41.0
Re: [PATCH 06/13] virfirewalld: Drop useless memset() in virFirewallDApplyRule()
Posted by Claudio Fontana 2 years, 6 months ago
On 8/3/23 12:36, Michal Privoznik wrote:
> This is a residue of v6.8.0-rc1~100. The error variable inside of
> virFirewallDApplyRule() is already initialized to NULL. There's
> no need to memset() it to zero again.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

Reviewed-by: Claudio Fontana <cfontana@suse.de>

> ---
>  src/util/virfirewalld.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c
> index 6fc54f357d..827e201dbb 100644
> --- a/src/util/virfirewalld.c
> +++ b/src/util/virfirewalld.c
> @@ -360,8 +360,6 @@ virFirewallDApplyRule(virFirewallLayer layer,
>      if (!sysbus)
>          return -1;
>  
> -    memset(&error, 0, sizeof(error));
> -

It was a quite convoluted way to just set a pointer to NULL ...



>      if (!ipv) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("Unknown firewall layer %1$d"),