Skip to content

Commit

Permalink
fix bug with last pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger Hu committed Jun 22, 2012
1 parent d3e9bc6 commit a48a3cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lxml/serializer.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ cdef char **_convert_ns_prefixes(inclusive_ns_prefixes):

num_inclusive_ns_prefixes = len(inclusive_ns_prefixes)

c_inclusive_ns_prefixes = <char **>python.PyMem_Malloc(sizeof(char *) * num_inclusive_ns_prefixes)
# Need to allocate one extra memory block to handle last NULL entry
c_inclusive_ns_prefixes = <char **>python.PyMem_Malloc(sizeof(char *) * (num_inclusive_ns_prefixes + 1))

# Converting Python object to C type
for n, inclusive_ns_prefix in enumerate(inclusive_ns_prefixes):
Expand Down

0 comments on commit a48a3cd

Please sign in to comment.