diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-10-16 23:16:25 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-10-16 23:16:25 (GMT) |
commit | 84581571e138d5b7984b6d3198296013ec157d30 (patch) | |
tree | e4308cab1f1bf85feaaeb91e33874b7ef7ccbcbb /plugins/pychrysa | |
parent | 6f9563a0184e36fab8d0c2c38d151827784e331e (diff) |
Fixed many bugs using valgrind.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@269 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa')
-rw-r--r-- | plugins/pychrysa/plugin.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/pychrysa/plugin.c b/plugins/pychrysa/plugin.c index 70ca26e..9601432 100644 --- a/plugins/pychrysa/plugin.c +++ b/plugins/pychrysa/plugin.c @@ -440,13 +440,20 @@ static MatchingFormatAction g_python_plugin_is_matching(const GPythonPlugin *plu if (result != MFA_NONE && new_data == Py_None) goto is_matching_bad; if (new_filename != Py_None) + { + free(*filename); *filename = strdup(PyString_AsString(new_filename)); + } + /** * La suppression de la part du greffon n'est permise que * si une prise en charge est assurée. */ else if (result != MFA_NONE) + { + free(*filename); *filename = NULL; + } /** * Pareil que précédemment. @@ -456,6 +463,8 @@ static MatchingFormatAction g_python_plugin_is_matching(const GPythonPlugin *plu tmp = PyByteArray_AsString(new_data); *length = PyByteArray_Size(new_data); + free(*data); + *data = (bin_t *)calloc(*length, sizeof(bin_t)); memcpy(*data, tmp, *length * sizeof(bin_t)); |