diff --git a/src/krb5/_context.pyx b/src/krb5/_context.pyx index e0a89c7..b2fc6b1 100644 --- a/src/krb5/_context.pyx +++ b/src/krb5/_context.pyx @@ -60,8 +60,12 @@ cdef class Context: def init_context() -> Context: + cdef krb5_error_code = 0 context = Context() - krb5_init_context(&context.raw) + + err = krb5_init_context(&context.raw) + if err: + raise Krb5Error(context, err) return context