[PATCH 05/13] remote_driver: Drop explicit memset(&sargs) in remoteAuthSASL()

Michal Privoznik posted 13 patches 2 years, 6 months ago
[PATCH 05/13] remote_driver: Drop explicit memset(&sargs) in remoteAuthSASL()
Posted by Michal Privoznik 2 years, 6 months ago
Inside of remoteAuthSASL() the sargs variable is already
initialized to zero during declaration. There's no need to
memset() it again as it's unused in between it's declaration and
said memset().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/remote/remote_driver.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index d775f65fe2..7ccf550dff 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -3833,7 +3833,6 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
         goto cleanup;
     }
     /* NB, distinction of NULL vs "" is *critical* in SASL */
-    memset(&sargs, 0, sizeof(sargs));
     sargs.nil = clientout ? 0 : 1;
     sargs.data.data_val = (char*)clientout;
     sargs.data.data_len = clientoutlen;
-- 
2.41.0
Re: [PATCH 05/13] remote_driver: Drop explicit memset(&sargs) in remoteAuthSASL()
Posted by Claudio Fontana 2 years, 6 months ago
On 8/3/23 12:36, Michal Privoznik wrote:
> Inside of remoteAuthSASL() the sargs variable is already
> initialized to zero during declaration. There's no need to
> memset() it again as it's unused in between it's declaration and
> said memset().
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

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

> ---
>  src/remote/remote_driver.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
> index d775f65fe2..7ccf550dff 100644
> --- a/src/remote/remote_driver.c
> +++ b/src/remote/remote_driver.c
> @@ -3833,7 +3833,6 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
>          goto cleanup;
>      }
>      /* NB, distinction of NULL vs "" is *critical* in SASL */
> -    memset(&sargs, 0, sizeof(sargs));
>      sargs.nil = clientout ? 0 : 1;
>      sargs.data.data_val = (char*)clientout;
>      sargs.data.data_len = clientoutlen;