[libvirt PATCH 3/5] secret: use g_new0 instead of VIR_ALLOC*

Ján Tomko posted 5 patches 5 years, 4 months ago
There is a newer version of this series
[libvirt PATCH 3/5] secret: use g_new0 instead of VIR_ALLOC*
Posted by Ján Tomko 5 years, 4 months ago
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/secret/secret_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 1cb342878f..45da09322b 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -459,8 +459,7 @@ secretStateInitialize(bool privileged,
                       virStateInhibitCallback callback G_GNUC_UNUSED,
                       void *opaque G_GNUC_UNUSED)
 {
-    if (VIR_ALLOC(driver) < 0)
-        return VIR_DRV_STATE_INIT_ERROR;
+    driver = g_new0(virSecretDriverState, 1);
 
     driver->lockFD = -1;
     if (virMutexInit(&driver->lock) < 0) {
-- 
2.26.2

Re: [libvirt PATCH 3/5] secret: use g_new0 instead of VIR_ALLOC*
Posted by Daniel Henrique Barboza 5 years, 4 months ago

On 9/23/20 5:11 PM, Ján Tomko wrote:
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   src/secret/secret_driver.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
> index 1cb342878f..45da09322b 100644
> --- a/src/secret/secret_driver.c
> +++ b/src/secret/secret_driver.c
> @@ -459,8 +459,7 @@ secretStateInitialize(bool privileged,
>                         virStateInhibitCallback callback G_GNUC_UNUSED,
>                         void *opaque G_GNUC_UNUSED)
>   {
> -    if (VIR_ALLOC(driver) < 0)
> -        return VIR_DRV_STATE_INIT_ERROR;
> +    driver = g_new0(virSecretDriverState, 1);
>   
>       driver->lockFD = -1;
>       if (virMutexInit(&driver->lock) < 0) {
>