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

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