mirror of
https://github.com/samba-team/samba.git
synced 2025-11-29 16:23:52 +03:00
s4-param: Check type when converting python object to lp_ctx, fix some
memory leaks.
This commit is contained in:
@@ -132,9 +132,8 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args)
|
||||
|
||||
tmp_ctx = talloc_new(NULL);
|
||||
|
||||
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||
lp_ctx = lpcfg_from_py_object(tmp_ctx, py_lp_ctx);
|
||||
if (lp_ctx == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
|
||||
talloc_free(tmp_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -38,9 +38,8 @@ class CredentialsTests(samba.tests.TestCase):
|
||||
def test_start_mech_by_unknown_name(self):
|
||||
self.assertRaises(RuntimeError, self.gensec.start_mech_by_name, "foo")
|
||||
|
||||
def test_start_mech_by_name(self):
|
||||
self.gensec.start_mech_by_name("spnego")
|
||||
|
||||
def test_info_uninitialized(self):
|
||||
self.assertRaises(RuntimeError, self.gensec.session_info)
|
||||
|
||||
def test_info(self):
|
||||
self.gensec.start_mech_by_name("spnego")
|
||||
self.assertEquals(None, self.gensec.session_info())
|
||||
|
||||
Reference in New Issue
Block a user