1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

param/pyparam: Cope with string list parameters being empty.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
This commit is contained in:
Ricardo Jorge 2009-08-04 00:03:04 +02:00 committed by Jelmer Vernooij
parent 1174177c8f
commit 3641978dfa

View File

@ -129,7 +129,13 @@ static PyObject *py_lp_ctx_get_helper(struct loadparm_context *lp_ctx, const cha
{
int j;
const char **strlist = *(const char ***)parm_ptr;
PyObject *pylist = PyList_New(str_list_length(strlist));
PyObject *pylist;
if(strlist == NULL) {
return PyList_New(0);
}
pylist = PyList_New(str_list_length(strlist));
for (j = 0; strlist[j]; j++)
PyList_SetItem(pylist, j,
PyString_FromString(strlist[j]));