struct pdb_methods *methods;
struct pdb_domain_info *domain_info;
PyObject *py_domain_info;
+ TALLOC_CTX *tframe;
methods = pytalloc_get_ptr(self);
- domain_info = methods->get_domain_info(methods, pytalloc_get_mem_ctx(self));
+ if ((tframe = talloc_stackframe()) == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ domain_info = methods->get_domain_info(methods, tframe);
if (! domain_info) {
Py_RETURN_NONE;
}
struct GUID guid;
*/
- talloc_free(domain_info);
+ talloc_free(tframe);
return py_domain_info;
}
{
PyObject *py_blist;
const struct pdb_init_function_entry *entry;
+ TALLOC_CTX *tframe;
+
+ if ((tframe = talloc_stackframe()) == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
entry = pdb_get_backends();
if(! entry) {
entry = entry->next;
}
+ talloc_free(tframe);
+
return py_blist;
}
static PyObject *py_set_smb_config(PyObject *self, PyObject *args)
{
const char *smb_config;
+ TALLOC_CTX *tframe;
if (!PyArg_ParseTuple(args, "s", &smb_config)) {
return NULL;
}
+ if ((tframe = talloc_stackframe()) == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
/* Load smbconf parameters */
if (!lp_load_global(smb_config)) {
PyErr_Format(py_pdb_error, "Cannot open '%s'", smb_config);
return NULL;
}
+ talloc_free(tframe);
+
Py_RETURN_NONE;
}
static PyObject *py_set_secrets_dir(PyObject *self, PyObject *args)
{
const char *private_dir;
+ TALLOC_CTX *tframe;
if (!PyArg_ParseTuple(args, "s", &private_dir)) {
return NULL;
}
+ if ((tframe = talloc_stackframe()) == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
/* Initialize secrets database */
if (!secrets_init_path(private_dir)) {
PyErr_Format(py_pdb_error, "Cannot open secrets file database in '%s'",
return NULL;
}
+ talloc_free(tframe);
+
Py_RETURN_NONE;
}