> @@ -556,7 +556,7 @@ gchar *utils_str_middle_truncate(const gchar *string, 
> guint truncate_length)
>  
>       length = strlen(string);
>  
> -     g_return_val_if_fail(g_utf8_validate(string, length, NULL), NULL);
> +     g_return_val_if_fail(g_utf8_validate(string, length, NULL), 
> g_strdup(string));

Wouldn't the `g_strdup(string)` leaked in case g_return_val_if_fail() does not 
return on fail?

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/547/files#r47446682

Reply via email to