mirror of
https://github.com/simon987/sist2.git
synced 2025-12-12 15:08:53 +00:00
Fix some memory leaks
This commit is contained in:
@@ -291,6 +291,7 @@ void incremental_copy(store_t *store, store_t *dst_store, const char *filepath,
|
||||
size_t buf_len;
|
||||
char *buf = store_read(store, (char *) line.uuid, 16, &buf_len);
|
||||
store_write(dst_store, (char *) line.uuid, 16, buf, buf_len);
|
||||
free(buf);
|
||||
|
||||
char c;
|
||||
while ((c = (char) getc(file))) {
|
||||
|
||||
@@ -64,7 +64,7 @@ void store_write(store_t *store, char *key, size_t key_len, char *buf, size_t bu
|
||||
// Cannot resize when there is a opened transaction.
|
||||
// Resize take effect on the next commit.
|
||||
pthread_rwlock_wrlock(&store->lock);
|
||||
store->size += 1024 * 1024 * 5;
|
||||
store->size += 1024 * 1024 * 50;
|
||||
mdb_env_set_mapsize(store->env, store->size);
|
||||
mdb_txn_begin(store->env, NULL, 0, &txn);
|
||||
put_ret = mdb_put(txn, store->dbi, &mdb_key, &mdb_value, 0);
|
||||
|
||||
Reference in New Issue
Block a user