libclamav/others.c: fix fd feak on error path - bb#1141

git-svn: trunk@4124
remotes/push_mirror/0.95
Tomasz Kojm 17 years ago
parent ecde411a9a
commit de5582b666
  1. 4
      ChangeLog
  2. 5
      libclamav/others.c

@ -1,3 +1,7 @@
Thu Aug 21 13:22:29 CEST 2008 (tk)
----------------------------------
* libclamav/others.c: fix fd feak on error path - bb#1141
Wed Aug 20 20:09:11 CEST 2008 (acab)
------------------------------------
* libclamav/sis.c: fix fd feak on error path - bb#1141

@ -800,8 +800,11 @@ int cli_filecopy(const char *src, const char *dest)
return -1;
}
if(!(buffer = cli_malloc(FILEBUFF)))
if(!(buffer = cli_malloc(FILEBUFF))) {
close(s);
close(d);
return -1;
}
while((bytes = cli_readn(s, buffer, FILEBUFF)) > 0)
cli_writen(d, buffer, bytes);

Loading…
Cancel
Save