diff options
author | Eric Blake <eblake@redhat.com> | 2011-07-04 09:45:21 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2011-07-04 09:45:21 +0800 |
commit | 2aa83b43d3ddb75a4e9eb9672d3bc608c2022c7c (patch) | |
tree | 477faeba96e2aea7ac8fb544f13ef6206ff6ddf6 | |
parent | pci: avoid memory leak on error (diff) | |
download | libvirt-2aa83b43d3ddb75a4e9eb9672d3bc608c2022c7c.tar.gz libvirt-2aa83b43d3ddb75a4e9eb9672d3bc608c2022c7c.tar.bz2 libvirt-2aa83b43d3ddb75a4e9eb9672d3bc608c2022c7c.zip |
rpc: fix logic bug
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.
-rw-r--r-- | 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 5c23cf241..30d7fcbd5 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; } |