plug leak in sigar_cache_destroy

This commit is contained in:
Doug MacEachern 2005-11-09 19:45:52 +00:00
parent 3756cbd6b8
commit db7081e550
1 changed files with 8 additions and 10 deletions

View File

@ -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;
}
do {
if (ptr->value) {
table->free_value(ptr->value);
while (entry) {
if (entry->value) {
table->free_value(entry->value);
}
} while ((ptr = ptr->next));
free(entry);
ptr = entry->next;
free(entry);
entry = ptr;
}
}
free(table->entries);