Address memory leak detected in wal_snapshot_init
Address memory leak detected in wal_snapshot_init

Clear out and free list items from a previous snapshot_open
if in the case of the current snapshot being reused again.

10:54:31 Direct leak of 2911296 byte(s) in 121304 object(s) allocated from:
10:54:31     #0 0x4ce6bb in calloc (/home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/build/forestdb/tests/usecase/usecase_test+0x4ce6bb)
10:54:31     #1 0x5c9b67 in Wal::_wal_snapshot_init(snap_handle*, _fdb_transaction*, unsigned long) /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/src/wal.cc:371:17
10:54:31     #2 0x5c9b67 in Wal::snapshotOpen_Wal(_fdb_transaction*, unsigned long, unsigned long, _fdb_key_cmp_info*, snap_handle**) /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/src/wal.cc:437
10:54:31     #3 0x562ebc in fdb_snapshot_open /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/src/forestdb.cc:1113:22
10:54:31     #4 0x4eeb04 in file_handle_reader_ops(FileHandlePool*, int) /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/tests/usecase/usecase_test.cc:451:14
10:54:31     #5 0x4f473a in invoke_reader_ops(void*) /home/couchbase/jenkins/workspace/forestdb-addresssanitizer-master/forestdb/tests/usecase/usecase_test.cc:601:13
10:54:31     #6 0x2af6b95d4e99 in start_thread /build/buildd/eglibc-2.15/nptl/pthread_create.c:308

Change-Id: I797c8b524860265c79aa59c08ceea916d328ac8d
Reviewed-on: http://review.couchbase.org/66065
Reviewed-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

couchbase/forestdb,hisundar/forestdb,wurikiji/forestdb,hisundar/forestdb,wurikiji/forestdb,couchbase/forestdb