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