conf: fix memleak in virDomainHostdevDefClear

use virNetworkRouteDefFree() instead of VIR_FREE to free routes, otherwise
the element 'family' would not be freed.

Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
Zhang Bo 2015-04-27 14:41:45 +08:00 committed by Ján Tomko
parent 7e3faa0959
commit d38d3c25f4

View File

@ -1882,7 +1882,7 @@ void virDomainHostdevDefClear(virDomainHostdevDefPtr def)
VIR_FREE(def->source.caps.u.net.ips[i]);
VIR_FREE(def->source.caps.u.net.ips);
for (i = 0; i < def->source.caps.u.net.nroutes; i++)
VIR_FREE(def->source.caps.u.net.routes[i]);
virNetworkRouteDefFree(def->source.caps.u.net.routes[i]);
VIR_FREE(def->source.caps.u.net.routes);
break;
}