[Github-comments] [geany] Locale/utf8 fixes (#547)

Enrico Tröger notifications at xxxxx
Sun Dec 13 16:19:18 UTC 2015


> @@ -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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20151213/e41aa2da/attachment.html>


More information about the Github-comments mailing list