Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e96fcb0

Browse files
committed
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.
1 parent fa4dad6 commit e96fcb0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contrib/pg_upgrade/function.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ check_loadable_libraries(void)
224224
{
225225
char *lib = os_info.libraries[libnum];
226226
int llen = strlen(lib);
227-
char *cmd = (char *) pg_malloc(8 + 2 * llen + 1);
227+
char cmd[7 + 2 * MAXPGPATH + 1];
228228
PGresult *res;
229229

230230
/*
@@ -261,7 +261,6 @@ check_loadable_libraries(void)
261261
}
262262

263263
PQclear(res);
264-
pg_free(cmd);
265264
}
266265

267266
PQfinish(conn);

0 commit comments

Comments
 (0)