libclamav: tweak to cli_gentempfd()

0.98.2
David Raynor 12 years ago
parent fde67491ec
commit d01f5c8dc5
  1. 10
      libclamav/others_common.c

@ -903,7 +903,6 @@ char *cli_gentemp(const char *dir)
int cli_gentempfd(const char *dir, char **name, int *fd)
{
*name = cli_gentemp(dir);
if(!*name)
return CL_EMEM;
@ -913,10 +912,11 @@ int cli_gentempfd(const char *dir, char **name, int *fd)
* EEXIST is almost impossible to occur, so we just treat it as other
* errors
*/
if(*fd == -1) {
cli_errmsg("cli_gentempfd: Can't create temporary file %s: %s\n", *name, strerror(errno));
free(*name);
return CL_ECREAT;
if(*fd == -1) {
cli_errmsg("cli_gentempfd: Can't create temporary file %s: %s\n", *name, strerror(errno));
free(*name);
*name = NULL;
return CL_ECREAT;
}
return CL_SUCCESS;

Loading…
Cancel
Save