[PATCH 01/23] virDomainNetDefParseXML: Automatically free GHashTable

Ján Tomko jtomko at redhat.com
Tue Nov 30 14:40:06 UTC 2021


On a Tuesday in 2021, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/conf/domain_conf.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>index f88405ab02..25e504a99a 100644
>--- a/src/conf/domain_conf.c
>+++ b/src/conf/domain_conf.c
>@@ -10244,7 +10244,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
>     xmlNodePtr vlan_node = NULL;
>     xmlNodePtr bandwidth_node = NULL;
>     xmlNodePtr tmpNode;
>-    GHashTable *filterparams = NULL;
>+    g_autoptr(GHashTable) filterparams = NULL;
>     virDomainActualNetDef *actual = NULL;
>     VIR_XPATH_NODE_AUTORESTORE(ctxt)
>     virDomainChrSourceReconnectDef reconnect = {0};
>@@ -10431,7 +10431,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
>
>     if ((filterref_node = virXPathNode("./filterref", ctxt))) {
>         filter = virXMLPropString(filterref_node, "filter");
>-        virHashFree(filterparams);

This virHashFree is called with a NULL parameter since the refactor to
xpath in commit fdd06824e3a618ca33752e0439bbd5b2d9da1b0d

>         filterparams = virNWFilterParseParamAttributes(filterref_node);
>     }
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211130/bdf810f4/attachment-0001.sig>


More information about the libvir-list mailing list