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:
parent
36790f6c2c
commit
e81b8522d7
2 changed files with 5 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in a new issue