Skip to content

Commit 16e1ae7

Browse files
committed
In pg_upgrade, fix a few place that used maloc/free rather than
pg_malloc/pg_free.
1 parent bc5430a commit 16e1ae7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

contrib/pg_upgrade/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ get_canonical_locale_name(int category, const char *locale)
987987
if (!setlocale(category, save))
988988
pg_log(PG_FATAL, "failed to restore old locale \"%s\"\n", save);
989989

990-
free(save);
990+
pg_free(save);
991991

992992
return res;
993993
}

contrib/pg_upgrade/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
148148
return -1;
149149
}
150150

151-
buffer = (char *) malloc(COPY_BUF_SIZE);
151+
buffer = (char *) pg_malloc(COPY_BUF_SIZE);
152152

153153
if (buffer == NULL)
154154
{
@@ -171,7 +171,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
171171
int save_errno = errno;
172172

173173
if (buffer != NULL)
174-
free(buffer);
174+
pg_free(buffer);
175175

176176
if (src_fd != 0)
177177
close(src_fd);
@@ -194,7 +194,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
194194
int save_errno = errno ? errno : ENOSPC;
195195

196196
if (buffer != NULL)
197-
free(buffer);
197+
pg_free(buffer);
198198

199199
if (src_fd != 0)
200200
close(src_fd);
@@ -208,7 +208,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
208208
}
209209

210210
if (buffer != NULL)
211-
free(buffer);
211+
pg_free(buffer);
212212

213213
if (src_fd != 0)
214214
close(src_fd);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy