mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-08 20:41:59 +03:00
* (edit_read_syntax_rules): Fix memory corruption if key is redefined
This commit is contained in:
parent
6747ef213e
commit
0c03bd9dd3
@ -808,10 +808,10 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args)
|
|||||||
break_a;
|
break_a;
|
||||||
if ((t = g_tree_lookup (defines, key))){
|
if ((t = g_tree_lookup (defines, key))){
|
||||||
g_free (t);
|
g_free (t);
|
||||||
t = g_strdup (value);
|
|
||||||
} else {
|
} else {
|
||||||
g_tree_insert (defines, g_strdup (key), g_strdup (value));
|
key = g_strdup (key);
|
||||||
}
|
}
|
||||||
|
g_tree_insert (defines, key, g_strdup (value));
|
||||||
} else { /* anything else is an error */
|
} else { /* anything else is an error */
|
||||||
break_a;
|
break_a;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user