summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/function.c
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
commite96fcb06b9721f975daed229c0c61f283d320357 (patch)
tree845388fd39c44824e79131a5f839d7c1ceb4aa39 /contrib/pg_upgrade/function.c
parentfa4dad6cc0fe7b66b2627ce7124a7767bfbaba63 (diff)
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.
Diffstat (limited to 'contrib/pg_upgrade/function.c')
-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 c5627111284..4878ded6615 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);