summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-01-25 09:35:17 -0500
committerBruce Momjian <bruce@momjian.us>2012-01-25 09:35:17 -0500
commit6d5aae7afacc564ead2af88c76b13cfc55750556 (patch)
treeefd470112974e0cfe3acf57d241d5c5471ec9acd
parenta7f2c79a6eebccd94aade2b03d40a2caeba8a5c3 (diff)
downloadpostgresql-6d5aae7afacc564ead2af88c76b13cfc55750556.tar.gz
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.
-rw-r--r--contrib/pg_upgrade/function.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/pg_upgrade/function.c b/contrib/pg_upgrade/function.c
index 988486b450..267f29143d 100644
--- a/contrib/pg_upgrade/function.c
+++ b/contrib/pg_upgrade/function.c
@@ -225,7 +225,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;
/*
@@ -266,7 +266,6 @@ check_loadable_libraries(void)
}
PQclear(res);
- pg_free(cmd);
}
PQfinish(conn);