]> granicus.if.org Git - postgresql/commitdiff
Now that the shared library name can be adjusted in the library test,
authorBruce Momjian <bruce@momjian.us>
Wed, 25 Jan 2012 14:35:17 +0000 (09:35 -0500)
committerBruce Momjian <bruce@momjian.us>
Wed, 25 Jan 2012 14:35:17 +0000 (09:35 -0500)
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.

contrib/pg_upgrade/function.c

index c5627111284fd93d424de5448e5eb27e4fd86c2e..4878ded661591b527da2632e24355731ddfae527 100644 (file)
@@ -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);