[PATCH 01/14] hypervFreeInvokeParams: Don't use VIR_DISPOSE_N for freeing 'params'

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

 



The struct doesn't contain any secrets to clear before freeing and even
if it did VIR_DISPOSE_N wouldn't help as the struct contains only
pointers thus the actual memory pointing to isn't sanitized.

Just free the params array pointer and then the struct itself.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/hyperv/hyperv_wmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index a28bb0e815..3bb75392a7 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -184,8 +184,8 @@ hypervFreeInvokeParams(hypervInvokeParamsListPtr params)
         }
     }

-    VIR_DISPOSE_N(params->params, params->nbAvailParams);
-    VIR_FREE(params);
+    g_free(params->params);
+    g_free(params);
 }


-- 
2.29.2




[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