mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-28 17:46:53 -04:00
hashindex: fix memory leak, fixes #9497
Thanks to @rolandrc for finding and fixing this! Also: set index->buckets = NULL to indicate "we are finished with this" and avoid use-after-free.
This commit is contained in:
parent
dd7111410f
commit
b9aaf24949
1 changed files with 2 additions and 0 deletions
|
|
@ -107,11 +107,13 @@ hashindex_free_buckets(HashIndex *index)
|
|||
#ifndef BORG_NO_PYTHON
|
||||
if(index->buckets_buffer.buf) {
|
||||
PyBuffer_Release(&index->buckets_buffer);
|
||||
index->buckets_buffer.buf = NULL;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
free(index->buckets);
|
||||
}
|
||||
index->buckets = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue