Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit16e1ae7

Browse files
committed
In pg_upgrade, fix a few place that used maloc/free rather than
pg_malloc/pg_free.
1 parentbc5430a commit16e1ae7

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
returnres;
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
intsave_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
intsave_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)

[8]ページ先頭

©2009-2025 Movatter.jp