summaryrefslogtreecommitdiff
path: root/src/format/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/format.c')
-rw-r--r--src/format/format.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/format/format.c b/src/format/format.c
index 4f6df03..f1ea4d4 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -503,6 +503,7 @@ bool init_all_formats(void)
GBinFormat *load_new_format(FormatType type, char *filename, bin_t **content, off_t *length)
{
GBinFormat *result; /* Adresse à retourner */
+ char *tmp; /* Nom de fichier modifiable */
GPluginModule **pglist; /* Liste de greffons */
size_t pgcount; /* Taille de cette liste */
size_t i; /* Boucle de parcours */
@@ -513,6 +514,8 @@ GBinFormat *load_new_format(FormatType type, char *filename, bin_t **content, of
+ tmp = strdup(filename);
+
pglist = get_all_plugins_for_action(PGA_FORMAT_MATCHER, &pgcount);
if (pgcount > 0)
@@ -520,7 +523,7 @@ GBinFormat *load_new_format(FormatType type, char *filename, bin_t **content, of
lnf_rescan:
for (i = 0; i < pgcount; i++)
- switch (g_plugin_module_is_matching(pglist[i], &filename, content, length))
+ switch (g_plugin_module_is_matching(pglist[i], &tmp, content, length))
{
case MFA_MATCHED:
/* FIXME */
@@ -539,6 +542,10 @@ GBinFormat *load_new_format(FormatType type, char *filename, bin_t **content, of
}
+ if (tmp == NULL)
+ free(tmp);
+
+
for (i = 0; i < FID_COUNT && result == NULL; i++)