In pg_upgrade, fix a few place that used maloc/free rather than
pg_malloc/pg_free.
This commit is contained in:
parent
bc5430aa95
commit
16e1ae77f9
|
@ -987,7 +987,7 @@ get_canonical_locale_name(int category, const char *locale)
|
|||
if (!setlocale(category, save))
|
||||
pg_log(PG_FATAL, "failed to restore old locale \"%s\"\n", save);
|
||||
|
||||
free(save);
|
||||
pg_free(save);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
|
|||
return -1;
|
||||
}
|
||||
|
||||
buffer = (char *) malloc(COPY_BUF_SIZE);
|
||||
buffer = (char *) pg_malloc(COPY_BUF_SIZE);
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
|
|||
int save_errno = errno;
|
||||
|
||||
if (buffer != NULL)
|
||||
free(buffer);
|
||||
pg_free(buffer);
|
||||
|
||||
if (src_fd != 0)
|
||||
close(src_fd);
|
||||
|
@ -194,7 +194,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
|
|||
int save_errno = errno ? errno : ENOSPC;
|
||||
|
||||
if (buffer != NULL)
|
||||
free(buffer);
|
||||
pg_free(buffer);
|
||||
|
||||
if (src_fd != 0)
|
||||
close(src_fd);
|
||||
|
@ -208,7 +208,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
|
|||
}
|
||||
|
||||
if (buffer != NULL)
|
||||
free(buffer);
|
||||
pg_free(buffer);
|
||||
|
||||
if (src_fd != 0)
|
||||
close(src_fd);
|
||||
|
|
Loading…
Reference in New Issue