logo       

samba-vscan/openantivirus vscan-oav_core.c,1.18.2.1,1.18.2.2: msg#00003

Subject: samba-vscan/openantivirus vscan-oav_core.c,1.18.2.1,1.18.2.2
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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe