plug leak in sigar_cache_destroy
This commit is contained in:
parent
3756cbd6b8
commit
db7081e550
|
@ -70,18 +70,16 @@ void sigar_cache_destroy(sigar_cache_t *table)
|
||||||
|
|
||||||
for (i=0; i<table->size; i++) {
|
for (i=0; i<table->size; i++) {
|
||||||
sigar_cache_entry_t *entry, *ptr;
|
sigar_cache_entry_t *entry, *ptr;
|
||||||
entry = ptr = *entries++;
|
entry = *entries++;
|
||||||
|
|
||||||
if (!entry) {
|
while (entry) {
|
||||||
continue;
|
if (entry->value) {
|
||||||
|
table->free_value(entry->value);
|
||||||
}
|
}
|
||||||
|
ptr = entry->next;
|
||||||
do {
|
|
||||||
if (ptr->value) {
|
|
||||||
table->free_value(ptr->value);
|
|
||||||
}
|
|
||||||
} while ((ptr = ptr->next));
|
|
||||||
free(entry);
|
free(entry);
|
||||||
|
entry = ptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(table->entries);
|
free(table->entries);
|
||||||
|
|
Loading…
Reference in New Issue