]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py_net: make use of pytalloc_GenericObject_steal()
authorStefan Metzmacher <metze@samba.org>
Wed, 22 Feb 2017 09:14:10 +0000 (10:14 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 25 Feb 2017 01:39:11 +0000 (02:39 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/libnet/py_net.c

index 3e70c79ea743fb38276ae489f1bae14f005e5eb1..5180c247a716b44f0fa1dc91f0c2005bc5d28f12 100644 (file)
@@ -457,7 +457,7 @@ static PyObject *py_net_replicate_init(py_net_Object *self, PyObject *args, PyOb
        s->chunk.forest = &s->forest;
        s->chunk.dest_dsa = &s->dest_dsa;
 
-       return pytalloc_CObject_FromTallocPtr(s);
+       return pytalloc_GenericObject_steal(s);
 }
 
 
@@ -485,9 +485,8 @@ static PyObject *py_net_replicate_chunk(py_net_Object *self, PyObject *args, PyO
                return NULL;
        }
 
-       s = talloc_get_type(PyCObject_AsVoidPtr(py_state), struct replicate_state);
+       s = pytalloc_get_type(py_state, struct replicate_state);
        if (!s) {
-               PyErr_SetString(PyExc_TypeError, "Expected replication_state");
                return NULL;
        }