Re: [libvirt] [PATCH] conf: eliminate redundant VIR_ALLOC of 1st element of network DNS hosts.

2012-03-09 Thread Laine Stump
On 03/09/2012 04:23 AM, Michal Privoznik wrote: > On 09.03.2012 10:03, Laine Stump wrote: >> virNetworkDNSHostsDefParseXML was calling VIR_ALLOC(def->hosts) if >> def->hosts was NULL. This is a waste of time, though, since >> VIR_REALLOC_N is called a few lines further down, prior to any use of >>

Re: [libvirt] [PATCH] conf: eliminate redundant VIR_ALLOC of 1st element of network DNS hosts.

2012-03-09 Thread Michal Privoznik
On 09.03.2012 10:03, Laine Stump wrote: > virNetworkDNSHostsDefParseXML was calling VIR_ALLOC(def->hosts) if > def->hosts was NULL. This is a waste of time, though, since > VIR_REALLOC_N is called a few lines further down, prior to any use of > def->hosts. (initializing def->nhosts to 0 is also red

[libvirt] [PATCH] conf: eliminate redundant VIR_ALLOC of 1st element of network DNS hosts.

2012-03-09 Thread Laine Stump
virNetworkDNSHostsDefParseXML was calling VIR_ALLOC(def->hosts) if def->hosts was NULL. This is a waste of time, though, since VIR_REALLOC_N is called a few lines further down, prior to any use of def->hosts. (initializing def->nhosts to 0 is also redundant, because the newly allocated memory will