fix memory leaks

git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@2457 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
sears 2011-04-25 15:28:45 +00:00
parent 36790f6c2c
commit e81b8522d7
2 changed files with 5 additions and 1 deletions

View file

@ -68,6 +68,7 @@ bloom_filter_t * bloom_filter_create(uint64_t(*func_a)(const char*,int),
}
void bloom_filter_destroy(bloom_filter_t* bf) {
free(bf->buckets);
free(bf->result_scratch_space);
free(bf);
}
// XXX this uses %. It would be better if it used &, but that would potentially double the memory we use. #define a flag.

View file

@ -145,8 +145,10 @@ void logtable<TUPLE>::openTable(int xid, recordid rid) {
template<class TUPLE>
void logtable<TUPLE>::logUpdate(datatuple * tup) {
LogEntry * e = stasis_log_write_update(log_file, 0, INVALID_PAGE, 0/*Page**/, 0/*op*/, tup->to_bytes(), tup->byte_length());
byte * buf = tup->to_bytes();
LogEntry * e = stasis_log_write_update(log_file, 0, INVALID_PAGE, 0/*Page**/, 0/*op*/, buf, tup->byte_length());
log_file->write_entry_done(log_file,e);
free(buf);
}
template<class TUPLE>
@ -165,6 +167,7 @@ void logtable<TUPLE>::replayLog() {
default: assert(e->type == UPDATELOG); abort();
}
}
freeLogHandle(lh);
recovering = false;
printf("\nLog replay complete.\n");