summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/plugin.c')
-rw-r--r--plugins/pychrysa/plugin.c9
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));