|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -253,7 +253,6 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
|
253 | 253 | fd=PathNameOpenFile(path,O_RDWR |PG_BINARY,0600);
|
254 | 254 | if (fd<0)
|
255 | 255 | {
|
256 |
| -pfree(path); |
257 | 256 | /* be sure to report the error reported by create, not open */
|
258 | 257 | errno=save_errno;
|
259 | 258 | ereport(ERROR,
|
@@ -499,10 +498,12 @@ mdopen(SMgrRelation reln, ForkNumber forknum, ExtensionBehavior behavior)
|
499 | 498 | fd=PathNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL |PG_BINARY,0600);
|
500 | 499 | if (fd<0)
|
501 | 500 | {
|
502 |
| -pfree(path); |
503 | 501 | if (behavior==EXTENSION_RETURN_NULL&&
|
504 | 502 | FILE_POSSIBLY_DELETED(errno))
|
| 503 | +{ |
| 504 | +pfree(path); |
505 | 505 | returnNULL;
|
| 506 | +} |
506 | 507 | ereport(ERROR,
|
507 | 508 | (errcode_for_file_access(),
|
508 | 509 | errmsg("could not open relation %s: %m",path)));
|
|