diff --git a/proc-cache.c b/proc-cache.c index 4fd0510..cc9de44 100644 --- a/proc-cache.c +++ b/proc-cache.c @@ -217,7 +217,7 @@ void proc_cache_purge(unsigned int timestamp) { } } -void proc_cache_flush() { +void proc_cache_close() { int i; struct header hdr; @@ -246,24 +246,14 @@ void proc_cache_flush() { write(fd, &ondisk.hash, 20); write(fd, &ondisk.time, sizeof(ondisk.time)); + + free(entry); } + hash_free(&table); + /* Flush it to the real file */ commit_lock(&lock); -} - -void proc_cache_close() { - - int i; - - proc_cache_flush(); release_lock(&lock); - - for(i=0; i < table.size; i++) { - struct proc_cache_entry *entry = hash_entry(&table, i); - if (entry) - free(entry); - } - hash_free(&table); } diff --git a/proc-cache.h b/proc-cache.h index 0f608ea..d347ac3 100644 --- a/proc-cache.h +++ b/proc-cache.h @@ -28,8 +28,6 @@ void proc_cache_update(const char *url); void proc_cache_purge(unsigned int timestamp); -void proc_cache_flush(); - void proc_cache_close(); #endif /* PROC_CACHE_H */