Skip to content

Commit

Permalink
Merge pull request #1368 from SpadesA99/master
Browse files Browse the repository at this point in the history
Fix CP command file occupation
  • Loading branch information
rkervella authored Aug 2, 2023
2 parents 4f2767a + ef1e12e commit 4faaa4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions implant/sliver/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ func cpHandler(data []byte, resp RPCResponse) {
resp(data, err)
return
}

defer srcFile.Close()

dstFile, err := os.Create(cpReq.Dst)
if err != nil {
// {{if .Config.Debug}}
Expand All @@ -340,7 +341,8 @@ func cpHandler(data []byte, resp RPCResponse) {
resp(data, err)
return
}

defer dstFile.Close()

bytesWritten, err := io.Copy(dstFile, srcFile)
if err != nil {
// {{if .Config.Debug}}
Expand Down

0 comments on commit 4faaa4c

Please sign in to comment.