summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2020-03-16 15:54:00 +0000
committerAndrew Bartlett <abartlet@samba.org>2020-03-19 20:46:42 +0000
commit9e84f1e5767c23c0e75a0954ac9c3668d18baa30 (patch)
tree52f5a5a346c7a9defa8cb13f66eee564316c4016 /source4/param
parent32d56271eb7ebf694c08c226c80fdf97a885fe46 (diff)
downloadsamba-9e84f1e5767c23c0e75a0954ac9c3668d18baa30.tar.gz
s4/param: treat NULL value passed to dict_insert as error
insert_dict is used as a convenience to decrement the values to prevent leaks with orpahaned PyObjects and avoid excessive creation of temp variables. if (!dict_insert(parameters, "rootdn", PyUnicode_FromString(settings->root_dn_str))) { status = NT_STATUS_UNSUCCESSFUL; goto out; } Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/provision.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 60ce07384f8..5cf38c66dd2 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -35,6 +35,9 @@ static bool dict_insert(PyObject* dict,
const char* key,
PyObject* value)
{
+ if (value == NULL) {
+ return false;
+ }
if (PyDict_SetItemString(dict, key, value) == -1) {
Py_XDECREF(value);
return false;