aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-07-04 09:45:21 +0800
committerDaniel Veillard <veillard@redhat.com>2011-07-04 09:45:21 +0800
commit2aa83b43d3ddb75a4e9eb9672d3bc608c2022c7c (patch)
tree477faeba96e2aea7ac8fb544f13ef6206ff6ddf6
parentpci: avoid memory leak on error (diff)
downloadlibvirt-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.c1
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;
}