mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
virNetDevBandwidthUnplug: Don't leak @cmd
When removing a TAP device, the associated bandwidth settings are removed. Currently, the /sbin/tc is used for that. It is spawned several times. Moreover, we use the same @cmd variable to construct the command and its arguments. That means we need to virCommandFree(cmd); prior to each virCommandNew(TC); which wasn't done.
This commit is contained in:
parent
bc13222185
commit
5995fcf04a
@ -519,6 +519,7 @@ virNetDevBandwidthUnplug(const char *brname,
|
||||
if (virCommandRun(cmd, &cmd_ret) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virCommandFree(cmd);
|
||||
cmd = virCommandNew(TC);
|
||||
virCommandAddArgList(cmd, "class", "del", "dev", brname,
|
||||
"classid", class_id, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user