Index: src/backend/commands/copy.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/commands/copy.c,v
retrieving revision 1.146
diff -c -r1.146 copy.c
*** src/backend/commands/copy.c	23 Feb 2002 21:46:02 -0000	1.146
--- src/backend/commands/copy.c	24 Feb 2002 02:28:07 -0000
***************
*** 337,343 ****
        
        fstat(fileno(fp),&st);
        if( S_ISDIR(st.st_mode) ){
!         fclose(fp);
          elog(ERROR,"COPY: %s is a directory.",filename);
        }
  		}
--- 337,343 ----
        
        fstat(fileno(fp),&st);
        if( S_ISDIR(st.st_mode) ){
! 		FreeFile(fp);
          elog(ERROR,"COPY: %s is a directory.",filename);
        }
  		}
***************
*** 389,395 ****
  					 (int) geteuid(), filename, strerror(errno), errno);
        fstat(fileno(fp),&st);
        if( S_ISDIR(st.st_mode) ){
!         fclose(fp);
          elog(ERROR,"COPY: %s is a directory.",filename);
        }
  		}
--- 389,395 ----
  					 (int) geteuid(), filename, strerror(errno), errno);
        fstat(fileno(fp),&st);
        if( S_ISDIR(st.st_mode) ){
! 		FreeFile(fp);
          elog(ERROR,"COPY: %s is a directory.",filename);
        }
  		}
