mirror of
https://github.com/postgres/postgres.git
synced 2025-06-06 00:02:36 -04:00
Free files on dir open failure in COPY.
This commit is contained in:
parent
0c124c5731
commit
0cd8cb1a03
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.146 2002/02/23 21:46:02 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.147 2002/02/24 02:32:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -337,7 +337,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
|
|
||||||
fstat(fileno(fp),&st);
|
fstat(fileno(fp),&st);
|
||||||
if( S_ISDIR(st.st_mode) ){
|
if( S_ISDIR(st.st_mode) ){
|
||||||
fclose(fp);
|
FreeFile(fp);
|
||||||
elog(ERROR,"COPY: %s is a directory.",filename);
|
elog(ERROR,"COPY: %s is a directory.",filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,7 +389,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
(int) geteuid(), filename, strerror(errno), errno);
|
(int) geteuid(), filename, strerror(errno), errno);
|
||||||
fstat(fileno(fp),&st);
|
fstat(fileno(fp),&st);
|
||||||
if( S_ISDIR(st.st_mode) ){
|
if( S_ISDIR(st.st_mode) ){
|
||||||
fclose(fp);
|
FreeFile(fp);
|
||||||
elog(ERROR,"COPY: %s is a directory.",filename);
|
elog(ERROR,"COPY: %s is a directory.",filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user