[PATCH 08/10] network: Rework networkGetDHCPLeases()
Michal Privoznik
mprivozn at redhat.com
Tue Jan 5 11:54:08 UTC 2021
On 1/5/21 12:49 PM, John Ferlan wrote:
>
>
> On 12/18/20 10:09 AM, Michal Privoznik wrote:
>> Firstly, bring variables that are used only within loops into
>> their respective loops. Secondly, drop 'error' label which is
>> redundant since we have @rv which holds the return value.
>> Thirdly, fix indendation in one case, the rest is indented
>> properly.
>>
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>> src/network/bridge_driver.c | 47 +++++++++++++++++--------------------
>> 1 file changed, 22 insertions(+), 25 deletions(-)
>>
>
> [...]
>
>> @@ -4145,7 +4146,7 @@ networkGetDHCPLeases(virNetworkPtr net,
>> /* A lease without ip-address makes no sense */
>> virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>> _("found lease without ip-address"));
>> - goto error;
>> + goto cleanup;
>> }
>>
>> /* Unlike IPv4, IPv6 uses ':' instead of '.' as separator */
>> @@ -4154,7 +4155,7 @@ networkGetDHCPLeases(virNetworkPtr net,
>>
>> /* Obtain prefix */
>> for (j = 0; j < def->nips; j++) {
>> - ipdef_tmp = &def->ips[j];
>> + virNetworkIPDefPtr ipdef_tmp = ipdef_tmp = &def->ips[j];
>
> Coverity notes... Department of redundancy department
>
> Simple/trivial fix for someone I'm sure
Huh, how I managed to write this? :-)
I'll push the fix as trivial shortly. Thanks for noticing.
Michal
More information about the libvir-list
mailing list