The corruption seems to be caused by midori_web_settings_add_style using strings after they're freed--its arguments are freed by the caller in the usage cases implemented so far. The signature should definitely be a const gchar* for the rule_id and should either be transfer-all or another const gchar* for the style itself. If it's transfer-all, the string will have to be freed in remove_style.
The corruption seems to be caused by midori_ web_settings_ add_style using strings after they're freed--its arguments are freed by the caller in the usage cases implemented so far. The signature should definitely be a const gchar* for the rule_id and should either be transfer-all or another const gchar* for the style itself. If it's transfer-all, the string will have to be freed in remove_style.