Update of /cvsroot/openantivirus/samba-vscan/openantivirus
In directory sc8-pr-cvs1:/tmp/cvs-serv19342/openantivirus
Modified Files:
Tag: VSCAN_0_3
vscan-oav_core.c
Log Message:
close input/output streams to avoid memory leaks
Index: vscan-oav_core.c
===================================================================
RCS file:
/cvsroot/openantivirus/samba-vscan/openantivirus/Attic/vscan-oav_core.c,v
retrieving revision 1.18.2.1
retrieving revision 1.18.2.2
diff -u -d -r1.18.2.1 -r1.18.2.2
--- vscan-oav_core.c 14 Jul 2003 13:09:19 -0000 1.18.2.1
+++ vscan-oav_core.c 3 Jan 2004 14:59:41 -0000 1.18.2.2
@@ -109,6 +109,8 @@
fpout = fdopen(sockfd, "w");
if ( fpout == NULL ) {
+ /* close fpin */
+ fclose(fpin);
vscan_syslog("ERROR: can not open stream for writing - %s",
strerror(errno));
return -1;
}
@@ -127,6 +129,9 @@
/* write to socket-stream */
if ( fputs(oavCommand, fpout) == EOF) {
vscan_syslog("ERROR: can not send file name to ScannerDaemon!");
+ /* closing streams */
+ fclose(fpin);
+ fclose(fpout);
return -1;
}
@@ -138,9 +143,16 @@
/* read from socket-stream */
if ( fgets(recvline, MAXLINE, fpin) == NULL ) {
+ /* close streams */
+ fclose(fpin);
+ fclose(fpout);
vscan_syslog("ERROR: can not get result from ScannerDaemon!");
return -1;
}
+
+ /* close streams */
+ fclose(fpin);
+ fclose(fpout);
/* Response from ScannerDaemon is either
- OK file scanned and not infected
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
|