mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	dbase_redo: Fix Valgrind-reported memory leak
Introduced by my (Álvaro's) commit9e4f914b5e, which was itself backpatched to pg10, though only pg15 and up contain the problem because of commit9c08aea6a3. This isn't a particularly significant leak, but given the fix is trivial, we might as well backpatch to all branches where it applies, so do that. Author: Nathan Bossart <nathandbossart@gmail.com> Reported-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/x4odfdlrwvsjawscnqsqjpofvauxslw7b4oyvxgt5owoyf4ysn@heafjusodrz7
This commit is contained in:
		@@ -3289,6 +3289,7 @@ dbase_redo(XLogReaderState *record)
 | 
				
			|||||||
		parent_path = pstrdup(dbpath);
 | 
							parent_path = pstrdup(dbpath);
 | 
				
			||||||
		get_parent_directory(parent_path);
 | 
							get_parent_directory(parent_path);
 | 
				
			||||||
		recovery_create_dbdir(parent_path, true);
 | 
							recovery_create_dbdir(parent_path, true);
 | 
				
			||||||
 | 
							pfree(parent_path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Create the database directory with the version file. */
 | 
							/* Create the database directory with the version file. */
 | 
				
			||||||
		CreateDirAndVersionFile(dbpath, xlrec->db_id, xlrec->tablespace_id,
 | 
							CreateDirAndVersionFile(dbpath, xlrec->db_id, xlrec->tablespace_id,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user