open-file: Fix user-after-free

This commit is contained in:
Daan De Meyer 2023-01-13 11:40:40 +01:00
parent d59ce37c28
commit 85e2e80699

View file

@ -54,7 +54,7 @@ int open_file_parse(const char *v, OpenFile **ret) {
}
if (isempty(of->fdname)) {
free(of->fdname);
of->fdname = mfree(of->fdname);
r = path_extract_filename(of->path, &of->fdname);
if (r < 0)
return r;