mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
virHashRemoveSet bugfixes
* src/hash.c: fix a couple of problems in virHashRemoveSet based on Hiroyuki Kaguchi patch and explanations. Daniel
This commit is contained in:
parent
247df6e448
commit
e9b3bc773d
@ -1,3 +1,8 @@
|
||||
Thu Feb 7 17:46:14 CET 2008 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/hash.c: fix a couple of problems in virHashRemoveSet based
|
||||
on Hiroyuki Kaguchi patch and explanations.
|
||||
|
||||
Thu Feb 7 17:48:30 CET 2008 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Mark all qemudLog diagnostics for translation.
|
||||
@ -52,6 +57,8 @@ Thu Feb 7 17:48:30 CET 2008 Jim Meyering <meyering@redhat.com>
|
||||
* src/xml.c (virXPathString): Likewise.
|
||||
* tests/xmlrpctest.c (checkRequestValue): Likewise.
|
||||
|
||||
2008-02-07 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* src/xm_internal.c: Remove trailing blanks
|
||||
* NEWS, ChangeLog: Likewise.
|
||||
|
||||
|
@ -537,9 +537,11 @@ int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDealloc
|
||||
count++;
|
||||
f(entry->payload, entry->name);
|
||||
free(entry->name);
|
||||
table->nbElems--;
|
||||
if (prev) {
|
||||
prev->next = entry->next;
|
||||
free(entry);
|
||||
entry = prev;
|
||||
} else {
|
||||
if (entry->next == NULL) {
|
||||
entry->valid = 0;
|
||||
@ -549,16 +551,14 @@ int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDealloc
|
||||
memcpy(&(table->table[i]), entry,
|
||||
sizeof(virHashEntry));
|
||||
free(entry);
|
||||
entry = NULL;
|
||||
entry = &(table->table[i]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
table->nbElems--;
|
||||
}
|
||||
prev = entry;
|
||||
if (entry) {
|
||||
entry = entry->next;
|
||||
} else {
|
||||
entry = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user