summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/pyldb.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-01 13:59:02 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-01 13:59:02 +0200
commit54ea150f364f9c39a9f0a2abe5a98e82df62845a (patch)
tree8a51f26bcb4ae8f835abf8b0777945a1e94f6f35 /source4/lib/ldb/pyldb.c
parente80891db4123a2ae326517c27c559ace18b0f05b (diff)
downloadsamba-54ea150f364f9c39a9f0a2abe5a98e82df62845a.tar.gz
samba-54ea150f364f9c39a9f0a2abe5a98e82df62845a.tar.bz2
samba-54ea150f364f9c39a9f0a2abe5a98e82df62845a.zip
s4:ldb_msg_diff - Fixes up possible memory leaks and the python binding of it
Diffstat (limited to 'source4/lib/ldb/pyldb.c')
-rw-r--r--source4/lib/ldb/pyldb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 0fe4da9887..0dac61b8b7 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -956,6 +956,10 @@ static PyObject *py_ldb_msg_diff(PyLdbObject *self, PyObject *args)
}
diff = ldb_msg_diff(PyLdb_AsLdbContext(self), PyLdbMessage_AsMessage(py_msg_old), PyLdbMessage_AsMessage(py_msg_new));
+ if (!diff) {
+ PyErr_SetString(PyExc_KeyError, "Failed to generate the Ldb Message diff");
+ return NULL;
+ }
py_ret = PyLdbMessage_FromMessage(diff);