From: Bruce Momjian Date: Wed, 25 Jan 2012 14:35:17 +0000 (-0500) Subject: Now that the shared library name can be adjusted in the library test, X-Git-Tag: REL9_1_3~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e96fcb06b9721f975daed229c0c61f283d320357;p=postgresql 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. --- diff --git a/contrib/pg_upgrade/function.c b/contrib/pg_upgrade/function.c index c562711128..4878ded661 100644 --- a/contrib/pg_upgrade/function.c +++ b/contrib/pg_upgrade/function.c @@ -224,7 +224,7 @@ check_loadable_libraries(void) { 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; /* @@ -261,7 +261,6 @@ check_loadable_libraries(void) } PQclear(res); - pg_free(cmd); } PQfinish(conn);