Skip to content

Commit 7206233

Browse files
committed
Improved context init error handling in the presence of bad set_from_os values
1 parent f5cb1f0 commit 7206233

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

context.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ context_dealloc(getdns_ContextObject *self)
7070
getdns_context *context;
7171

7272
if ((context = PyCapsule_GetPointer(self->py_context, "context")) == NULL) {
73+
PyErr_Clear();
74+
PyErr_SetString(getdns_error, GETDNS_RETURN_BAD_CONTEXT_TEXT);
7375
return;
7476
}
7577
if (self->event_base)

0 commit comments

Comments
 (0)