[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/2] 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.
---
 src/util/virnetdevbandwidth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index ccc1449..74e6c8c 100644
--- a/src/util/virnetdevbandwidth.c
+++ b/src/util/virnetdevbandwidth.c
@@ -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);
-- 
1.8.1.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]