Skip to content

Commit

Permalink
dict-file: Fix memory leak when file is recreated during lock wait
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and cmouse committed Jun 29, 2018
1 parent 6aedc3b commit 856450f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib-dict/dict-file.c
Expand Up @@ -492,7 +492,9 @@ file_dict_lock(struct file_dict *dict, struct file_lock **lock_r,
dict->path);
}

*lock_r = NULL;
do {
file_lock_free(lock_r);
if (file_wait_lock(dict->fd, dict->path, F_WRLCK,
dict->lock_method,
file_dict_dotlock_settings.timeout,
Expand Down

0 comments on commit 856450f

Please sign in to comment.