summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-01-21 16:29:15 +1300
committerJelmer Vernooij <jelmer@samba.org>2010-01-21 16:29:15 +1300
commit7092e220b57867c35425f17d09c4cc1031932eda (patch)
treefe69de8a0f581edf50a1d8aa770a19a744cd6c63 /source4/librpc
parent342aff75c5400ef6be855094e2fe42f444cc40de (diff)
downloadsamba-7092e220b57867c35425f17d09c4cc1031932eda.tar.gz
samba-7092e220b57867c35425f17d09c4cc1031932eda.tar.bz2
samba-7092e220b57867c35425f17d09c4cc1031932eda.zip
pyxattr: Fix return value, raise exception, fix memory leak.
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/ndr/py_xattr.c7
1 files changed, 6 insertions, 1 deletions
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);