Skip to content

Commit 1267ce4

Browse files
committed
Added wait() to context_dealloc to reap wayward unbound processes
1 parent 8841e07 commit 1267ce4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

context.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <arpa/inet.h>
3131
#include <event2/event.h>
3232
#include <getdns/getdns_ext_libevent.h>
33+
#include <sys/wait.h>
3334
#include "pygetdns.h"
3435

3536
int
@@ -68,12 +69,14 @@ void
6869
context_dealloc(getdns_ContextObject *self)
6970
{
7071
getdns_context *context;
72+
int status;
7173

7274
if ((context = PyCapsule_GetPointer(self->py_context, "context")) == NULL) {
7375
return;
7476
}
7577
Py_XDECREF(self->py_context);
7678
getdns_context_destroy(context);
79+
(void)wait(&status); /* reap the process spun off by unbound */
7780
return;
7881
}
7982

0 commit comments

Comments
 (0)