git.samba.org
/
kai
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1174177
)
param/pyparam: Cope with string list parameters being empty.
author
Ricardo Jorge
<rvelhote@gmail.com>
Mon, 3 Aug 2009 22:03:04 +0000
(
00:03
+0200)
committer
Jelmer Vernooij
<jelmer@samba.org>
Mon, 3 Aug 2009 22:18:43 +0000
(
00:18
+0200)
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
source4/param/pyparam.c
patch
|
blob
|
history
diff --git
a/source4/param/pyparam.c
b/source4/param/pyparam.c
index 37e882e1cc876433aa1e1b89902341f320c6807e..58799f8d37f15c7eaae4257563a53298fd713fce 100644
(file)
--- a/
source4/param/pyparam.c
+++ b/
source4/param/pyparam.c
@@
-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]));