diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c
index cef4941d84..1ab19374c6 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -1237,6 +1237,7 @@ scan_for_existing_tablespaces(char *pathname, cb_options *opt)
 		ts->next = tslist;
 		tslist = ts;
 	}
+	closedir(dir);
 
 	return tslist;
 }