1. Andrew Dunstan
  2. pgdevel

Commits

Bruce Momjian  committed e96fcb0

Now that the shared library name can be adjusted in the library test,
have pg_upgrade allocate a maximum fixed size buffer for testing the
library file name, rather than base the allocation on the library name.

Backpatch to 9.1.

  • Participants
  • Parent commits fa4dad6

Comments (0)

Files changed (1)

File contrib/pg_upgrade/function.c

View file
  • Ignore whitespace
 	{
 		char	   *lib = os_info.libraries[libnum];
 		int			llen = strlen(lib);
-		char	   *cmd = (char *) pg_malloc(8 + 2 * llen + 1);
+		char		cmd[7 + 2 * MAXPGPATH + 1];
 		PGresult   *res;
 
 		/*
 		}
 
 		PQclear(res);
-		pg_free(cmd);
 	}
 
 	PQfinish(conn);