[libvirt] [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

Ján Tomko jtomko at redhat.com
Tue Jul 15 13:49:10 UTC 2014


On 07/15/2014 03:38 PM, Michal Privoznik wrote:
> On 15.07.2014 14:58, Ján Tomko wrote:
>> On 07/15/2014 02:38 PM, Michal Privoznik wrote:
>> IMO we should set n<elems> to 0 in all *Clear functions, not just
>> virNetworkDNSHostDefClear, after which NULL might be dereferenced based on the
>> n<elems> variable.
> 
> I don't see how that could be possible with current code. The
> virNetworkDNSHostDefClear is called only on cleanup paths where accessing
> def->names or def->forwarders is not possible anymore.
> 

In virNetworkDefUpdateDNSHost when parsing in virNetworkDNSHostDefParseXML
fails, DNSHostDefClear is called in both functions.

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140715/212c598e/attachment-0001.sig>


More information about the libvir-list mailing list