aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r--src/bin/scripts/common.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index c7cc04aea4b..03193b6fcdc 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -278,55 +278,6 @@ executeMaintenanceCommand(PGconn *conn, const char *query, bool echo)
}
/*
- * "Safe" wrapper around strdup(). Pulled from psql/common.c
- */
-char *
-pg_strdup(const char *string)
-{
- char *tmp;
-
- if (!string)
- {
- fprintf(stderr, _("pg_strdup: cannot duplicate null pointer (internal error)\n"));
- exit(EXIT_FAILURE);
- }
- tmp = strdup(string);
- if (!tmp)
- {
- fprintf(stderr, _("out of memory\n"));
- exit(EXIT_FAILURE);
- }
- return tmp;
-}
-
-void *
-pg_malloc(size_t size)
-{
- void *tmp;
-
- /* Avoid unportable behavior of malloc(0) */
- if (size == 0)
- size = 1;
- tmp = malloc(size);
- if (!tmp)
- {
- fprintf(stderr, _("out of memory\n"));
- exit(EXIT_FAILURE);
- }
- return tmp;
-}
-
-void *
-pg_malloc0(size_t size)
-{
- void *tmp;
-
- tmp = pg_malloc(size);
- MemSet(tmp, 0, size);
- return tmp;
-}
-
-/*
* Check yes/no answer in a localized way. 1=yes, 0=no, -1=neither.
*/