git.videolan.org
/
vlc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bab829
)
python bindings : fix pyoptions_to_args and a memleak in the same time
author
Rafaël Carré
<funman@videolan.org>
Tue, 25 Mar 2008 09:53:13 +0000
(10:53 +0100)
committer
Rafaël Carré
<funman@videolan.org>
Tue, 25 Mar 2008 09:53:13 +0000
(10:53 +0100)
bindings/python/vlc_instance.c
patch
|
blob
|
history
diff --git
a/bindings/python/vlc_instance.c
b/bindings/python/vlc_instance.c
index
332eb26
..
a9228dd
100644
(file)
--- a/
bindings/python/vlc_instance.c
+++ b/
bindings/python/vlc_instance.c
@@
-28,9
+28,6
@@
pyoptions_to_args(PyObject *py_options, char*** pppsz_args)
{
Py_ssize_t i_size;
Py_ssize_t i_index;
- char** ppsz_args = *pppsz_args;
-
- ppsz_args = NULL;
Py_INCREF( py_options );
if( ! PySequence_Check( py_options ) )
@@
-39,7
+36,9
@@
pyoptions_to_args(PyObject *py_options, char*** pppsz_args)
return -1;
}
i_size = PySequence_Size( py_options );
- ppsz_args = malloc( ( i_size + 1 ) * sizeof( char * ) );
+
+ char **ppsz_args = *pppsz_args = malloc( ( i_size + 1 ) * sizeof( char * ) );
+
if( ! ppsz_args )
{
PyErr_SetString( PyExc_MemoryError, "Out of memory" );