Blame SOURCES/0001-Unbreak-the-pmemblk-engine.patch

d2d37a
From 8644ef7c4c49aa6d6492b3b250a06b841496d7fd Mon Sep 17 00:00:00 2001
d2d37a
From: Bart Van Assche <bvanassche@acm.org>
d2d37a
Date: Sat, 27 Jun 2020 07:26:24 -0700
d2d37a
Subject: [PATCH] Unbreak the pmemblk engine
d2d37a
d2d37a
Reported-by: Yi Zhang <yi.zhang@redhat.com>
d2d37a
Tested-by: Yi Zhang <yi.zhang@redhat.com>
d2d37a
Fixes: e9c7be0e32e6 ("pmemblk: Fix a memory leak")
d2d37a
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
d2d37a
---
d2d37a
 engines/pmemblk.c | 4 ++--
d2d37a
 1 file changed, 2 insertions(+), 2 deletions(-)
d2d37a
d2d37a
diff --git a/engines/pmemblk.c b/engines/pmemblk.c
d2d37a
index 730f4d7..e2eaa15 100644
d2d37a
--- a/engines/pmemblk.c
d2d37a
+++ b/engines/pmemblk.c
d2d37a
@@ -220,14 +220,14 @@ static fio_pmemblk_file_t pmb_open(const char *pathspec, int flags)
d2d37a
 		pmb->pmb_nblocks = pmemblk_nblock(pmb->pmb_pool);
d2d37a
 
d2d37a
 		fio_pmemblk_cache_insert(pmb);
d2d37a
+	} else {
d2d37a
+		free(path);
d2d37a
 	}
d2d37a
 
d2d37a
 	pmb->pmb_refcnt += 1;
d2d37a
 
d2d37a
 	pthread_mutex_unlock(&CacheLock);
d2d37a
 
d2d37a
-	free(path);
d2d37a
-
d2d37a
 	return pmb;
d2d37a
 
d2d37a
 error:
d2d37a
-- 
d2d37a
2.9.5
d2d37a