From: Bart Van Assche Date: Sat, 18 Jan 2020 05:08:10 +0000 (-0800) Subject: pmemblk: Fix a memory leak X-Git-Tag: fio-3.18~10^2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e9c7be0e32e6ddaf40f73fd0ea1977a295842aec pmemblk: Fix a memory leak This patch fixes the following Coverity complaint: CID 169312 (#1 of 1): Resource leak (RESOURCE_LEAK) 5. leaked_storage: Variable path going out of scope leaks the storage it points to. Signed-off-by: Bart Van Assche --- diff --git a/engines/pmemblk.c b/engines/pmemblk.c index 45f6fb65..730f4d77 100644 --- a/engines/pmemblk.c +++ b/engines/pmemblk.c @@ -226,6 +226,8 @@ static fio_pmemblk_file_t pmb_open(const char *pathspec, int flags) pthread_mutex_unlock(&CacheLock); + free(path); + return pmb; error: