Plug a memory and fd leak if keeptemps is enabled

pull/69/head
Shawn Webb 11 years ago
parent 15ef4b1c61
commit 50dc7e62e9
  1. 9
      libclamav/xdp.c

@ -85,6 +85,8 @@ char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz)
cli_dbgmsg("dump_xdp: Dumped payload to %s\n", filename);
close(fd);
return filename;
}
@ -105,8 +107,11 @@ int cli_scanxdp(cli_ctx *ctx)
if (!(buf))
return CL_EREAD;
if (ctx->engine->keeptmp)
dump_xdp(ctx, buf, map->len);
if (ctx->engine->keeptmp) {
dumpname = dump_xdp(ctx, buf, map->len);
if (dumpname)
free(dumpname);
}
/*
* Since a PDF file can contain embedded XDP documents,

Loading…
Cancel
Save