diff --git a/src/exec.c b/src/exec.c
--- a/src/exec.c
+++ b/src/exec.c
char errbuf[1024];
ERROR ("exec plugin: fdopen (%i) failed: %s", fd,
sstrerror (errno, errbuf, sizeof (errbuf)));
- kill (pl->pid, SIGTERM);
- pl->pid = 0;
+ kill (pid, SIGTERM);
close (fd);
sfree (arg);
pthread_exit ((void *) 1);