From 7092e220b57867c35425f17d09c4cc1031932eda Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Jan 2010 16:29:15 +1300 Subject: pyxattr: Fix return value, raise exception, fix memory leak. --- source4/librpc/ndr/py_xattr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source4/librpc/ndr/py_xattr.c b/source4/librpc/ndr/py_xattr.c index 15f2b9c33a..9cf87e24a9 100644 --- a/source4/librpc/ndr/py_xattr.c +++ b/source4/librpc/ndr/py_xattr.c @@ -22,6 +22,7 @@ #ifndef Py_RETURN_NONE #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None #endif + static void PyType_AddMethods(PyTypeObject *type, PyMethodDef *methods) { PyObject *dict; @@ -69,7 +70,11 @@ static PyObject *py_ntacl_print(PyObject *self, PyObject *args) mem_ctx = talloc_new(NULL); pr = talloc_zero(mem_ctx, struct ndr_print); - if (!pr) return; + if (!pr) { + PyErr_NoMemory(); + talloc_free(mem_ctx); + return NULL; + } pr->print = ntacl_print_debug_helper; ndr_print_xattr_NTACL(pr, "file", ntacl); -- cgit