fix memory leak in stat cache

personal/stbuehler/wip
Thomas Porzelt 14 years ago
parent 158f42aa0f
commit d696e0e0f7
  1. 12
      src/stat_cache.c

@ -244,12 +244,14 @@ static stat_cache_entry *stat_cache_get_internal(vrequest *vr, GString *path, gb
if (sce->refcount == 0) {
/* no vrequests working on the entry, reuse it */
if (sce->type == STAT_CACHE_ENTRY_DIR) {
if (!dir) {
guint i;
for (i = 0; i < sce->dirlist->len; i++) {
g_string_free(g_array_index(sce->dirlist, stat_cache_entry_data, i).path, TRUE);
}
guint i;
/* free old entries */
for (i = 0; i < sce->dirlist->len; i++) {
g_string_free(g_array_index(sce->dirlist, stat_cache_entry_data, i).path, TRUE);
}
if (!dir) {
g_array_free(sce->dirlist, TRUE);
sce->type = STAT_CACHE_ENTRY_SINGLE;
} else {

Loading…
Cancel
Save