diff --git a/src/common/set.c b/src/common/set.c
index 1cbd12115deca3a1087303dc9811a489c8a4613f..a7fdd13330795243bed74e6ef4013954d96a40e3 100644
--- a/src/common/set.c
+++ b/src/common/set.c
@@ -3942,7 +3942,7 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize,
 	if ((*setp)->replica[0]->nparts == 0) {
 		errno = ENOENT;
 		ERR("!no parts in replicas");
-		return -1;
+		goto err_poolset_free;
 	}
 
 	if (cow && (*setp)->replica[0]->part[0].is_dev_dax) {