diff -urN src.orig/malware.c src/malware.c --- src.orig/malware.c Sat Sep 4 09:11:35 2004 +++ src/malware.c Tue Sep 21 09:23:46 2004 @@ -198,6 +198,7 @@ /* calc file size */ drweb_fd = open(CS scanrequest, O_RDONLY); if (drweb_fd == -1) { + close(sock); log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: drweb: can't open spool file %s: %s", scanrequest, strerror(errno)); @@ -205,6 +206,8 @@ } fsize = lseek(drweb_fd, 0, SEEK_END); if (fsize == -1) { + close(sock); + close(drweb_fd); log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: drweb: can't seek spool file %s: %s", scanrequest, strerror(errno)); @@ -239,20 +242,22 @@ if (result == -1) { close(sock); close(drweb_fd); + free(drweb_fbuf); log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: drweb: can't read spool file %s: %s", scanrequest, strerror(errno)); return DEFER; } + close(drweb_fd); /* send file body to socket */ if (send(sock, drweb_fbuf, fsize, 0) < 0) { close(sock); + free(drweb_fbuf); log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: drweb: unable to send file body to socket (%s)", drweb_options); return DEFER; } - close(drweb_fd); free(drweb_fbuf); } else {