
On Tue, Dec 04, 2007 at 10:10:28PM +0100, Jim Meyering wrote:
"Daniel P. Berrange" <berrange@redhat.com> wrote:
This adds a binding for the virConnectOpenAuth() api in the python API. This allows a python function to be used as the callback. diff -r 8a79678f789f python/libvir.c
--- a/python/libvir.c Wed Nov 28 23:01:30 2007 -0500 +++ b/python/libvir.c Wed Nov 28 23:29:40 2007 -0500 ... +static PyObject * +libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { ... + auth.ncredtype = PyList_Size(pycredtype); + if (auth.ncredtype) { + int i; + auth.credtype = malloc(sizeof(int) * auth.ncredtype);
Check for malloc failure:
if (!auth.credtype) return NULL;
THanks for that. Will make the change.. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|