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++) {
|
||||
sigar_cache_entry_t *entry, *ptr;
|
||||
entry = ptr = *entries++;
|
||||
entry = *entries++;
|
||||
|
||||
if (!entry) {
|
||||
continue;
|
||||
while (entry) {
|
||||
if (entry->value) {
|
||||
table->free_value(entry->value);
|
||||
}
|
||||
|
||||
do {
|
||||
if (ptr->value) {
|
||||
table->free_value(ptr->value);
|
||||
}
|
||||
} while ((ptr = ptr->next));
|
||||
ptr = entry->next;
|
||||
free(entry);
|
||||
entry = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
free(table->entries);
|
||||
|
|
Loading…
Reference in New Issue