mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
s4/pyauth: fix memory leak when context_new() has bad arguments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
f17e36c3f1
commit
1f9ac9135c
@ -361,12 +361,14 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
|
||||
|
||||
lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx);
|
||||
if (lp_ctx == NULL) {
|
||||
talloc_free(mem_ctx);
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ev = s4_event_context_init(mem_ctx);
|
||||
if (ev == NULL) {
|
||||
talloc_free(mem_ctx);
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user