]> xenbits.xensource.com Git - libvirt.git/commitdiff
hypervFreeInvokeParams: Don't use VIR_DISPOSE_N for freeing 'params'
authorPeter Krempa <pkrempa@redhat.com>
Mon, 1 Feb 2021 11:08:13 +0000 (12:08 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2021 12:07:12 +0000 (13:07 +0100)
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@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/hyperv/hyperv_wmi.c

index c14ff0e64a2efeba114f60a6c61b92f5babe7960..8bb6f591f18f78bf8548a79b1fe97bba12ee04e7 100644 (file)
@@ -184,8 +184,8 @@ hypervFreeInvokeParams(hypervInvokeParamsListPtr params)
         }
     }
 
-    VIR_DISPOSE_N(params->params, params->nbAvailParams);
-    VIR_FREE(params);
+    g_free(params->params);
+    g_free(params);
 }