Skip to content

Commit 0cd8cb1

Browse files
committed
Free files on dir open failure in COPY.
1 parent 0c124c5 commit 0cd8cb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/commands/copy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.146 2002/02/23 21:46:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.147 2002/02/24 02:32:26 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -337,7 +337,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
337337

338338
fstat(fileno(fp),&st);
339339
if( S_ISDIR(st.st_mode) ){
340-
fclose(fp);
340+
FreeFile(fp);
341341
elog(ERROR,"COPY: %s is a directory.",filename);
342342
}
343343
}
@@ -389,7 +389,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
389389
(int) geteuid(), filename, strerror(errno), errno);
390390
fstat(fileno(fp),&st);
391391
if( S_ISDIR(st.st_mode) ){
392-
fclose(fp);
392+
FreeFile(fp);
393393
elog(ERROR,"COPY: %s is a directory.",filename);
394394
}
395395
}

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