浏览代码

Bug 697027 - 3 - minor memory leaks found by Valgrind + TET

https://bugzilla.redhat.com/show_bug.cgi?id=697027
[Case 3]
Description: Adding slapi_counter_destroy to destroy counters
cache->c_cursize, c_hits, and c_tries used in the entry cache.
Noriko Hosoi 14 年之前
父节点
当前提交
55ea40a5c4
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      ldap/servers/slapd/back-ldbm/cache.c

+ 3 - 0
ldap/servers/slapd/back-ldbm/cache.c

@@ -642,6 +642,9 @@ static void erase_cache(struct cache *cache, int type)
 #ifdef UUIDCACHE_ON 
     slapi_ch_free((void **)&cache->c_uuidtable);
 #endif
+    slapi_counter_destroy(&cache->c_cursize);
+    slapi_counter_destroy(&cache->c_hits);
+    slapi_counter_destroy(&cache->c_tries);
 }
 
 /* to be used on shutdown or when destroying a backend instance */