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

Commitf06b760

Browse files
committed
Fix oversight in previous error-reporting patch; mustn't pfree path string
before passing it to elog.
1 parent6e82501 commitf06b760

File tree

1 file changed

+4
-3
lines changed
  • src/backend/storage/smgr

1 file changed

+4
-3
lines changed

‎src/backend/storage/smgr/md.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.140 2008/11/11 13:19:16 heikki Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.141 2008/11/14 11:09:50 heikki Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -253,7 +253,6 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
253253
fd=PathNameOpenFile(path,O_RDWR |PG_BINARY,0600);
254254
if (fd<0)
255255
{
256-
pfree(path);
257256
/* be sure to report the error reported by create, not open */
258257
errno=save_errno;
259258
ereport(ERROR,
@@ -499,10 +498,12 @@ mdopen(SMgrRelation reln, ForkNumber forknum, ExtensionBehavior behavior)
499498
fd=PathNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL |PG_BINARY,0600);
500499
if (fd<0)
501500
{
502-
pfree(path);
503501
if (behavior==EXTENSION_RETURN_NULL&&
504502
FILE_POSSIBLY_DELETED(errno))
503+
{
504+
pfree(path);
505505
returnNULL;
506+
}
506507
ereport(ERROR,
507508
(errcode_for_file_access(),
508509
errmsg("could not open relation %s: %m",path)));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp