mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-07 17:47:14 +00:00
Remove unreachable code, and don't leak contexts
This patch performs some minor cleanups for things detected by "go vet": - Remove one line of unreachable code. - Don't leak contexts until their deadline expires, cancel them.
This commit is contained in:
@@ -51,8 +51,9 @@ func (p *Procmail) Deliver(from string, to string, data []byte) (error, bool) {
|
||||
args = append(args, replacer.Replace(a))
|
||||
}
|
||||
|
||||
ctx, _ := context.WithDeadline(context.Background(),
|
||||
ctx, cancel := context.WithDeadline(context.Background(),
|
||||
time.Now().Add(p.Timeout))
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, p.Binary, args...)
|
||||
|
||||
cmdStdin, err := cmd.StdinPipe()
|
||||
|
||||
Reference in New Issue
Block a user