Browse code

use fclose() to flush data

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@681 77e5149b-7576-45b1-b177-96237e5ba77b

Trog authored on 2004/07/22 00:48:09
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Jul 21 16:47:06 BST 2004 (trog)
2
+-----------------------------------
3
+  * libclamav/chmunpack.c: use fclose() to flush data
4
+
1 5
 Wed Jul 21 04:14:34 CEST 2004 (tk)
2 6
 ----------------------------------
3 7
   * libclamav: pe: fix debug message
... ...
@@ -920,7 +920,8 @@ static int chm_decompress_stream(int fd, const char *dirname, itsf_header_t *its
920 920
 	lzxd_free(stream);
921 921
 	
922 922
 	entry = file_l->next;
923
-	close(mf_out.desc);
923
+	fclose(mf_out.fh);
924
+	mf_out.fh = NULL;
924 925
 	
925 926
 	/* Reopen the file for reading */
926 927
 	mf_out.desc = open(filename, O_RDONLY);
... ...
@@ -978,7 +979,9 @@ abort:
978 978
 	free(mf_in.name);
979 979
 	fclose(mf_in.fh);
980 980
 	free(mf_out.name);
981
-	fclose(mf_out.fh);
981
+	if (mf_out.fh) {
982
+		fclose(mf_out.fh);
983
+	}
982 984
 	close(mf_out.desc);
983 985
 	return retval;
984 986
 }