[PATCH 5/8] rpc: fix logic bug

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

 



Spotted by Coverity.  If we don't update tmp each time through
the loop, then if the filter being removed was not the head of
the list, we accidentally lose all filters prior to the one we
wanted to remove.

* src/rpc/virnetserverclient.c (virNetServerClientRemoveFilter):
Don't lose unrelated filters.
---
 src/rpc/virnetserverclient.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 5c23cf2..30d7fcb 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -240,6 +240,7 @@ void virNetServerClientRemoveFilter(virNetServerClientPtr client,
             VIR_FREE(tmp);
             break;
         }
+        prev = tmp;
         tmp = tmp->next;
     }

-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]