]> xenbits.xensource.com Git - libvirt.git/commitdiff
rpc: fix logic bug
authorEric Blake <eblake@redhat.com>
Mon, 4 Jul 2011 01:45:21 +0000 (09:45 +0800)
committerDaniel Veillard <veillard@redhat.com>
Mon, 4 Jul 2011 01:45:21 +0000 (09:45 +0800)
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

index 5c23cf2410fe18524fb54f9c75e9f6eb009be0bf..30d7fcbd5d4cbf0e687116af8e8fffd6eea248d7 100644 (file)
@@ -240,6 +240,7 @@ void virNetServerClientRemoveFilter(virNetServerClientPtr client,
             VIR_FREE(tmp);
             break;
         }
+        prev = tmp;
         tmp = tmp->next;
     }