path: free GLib error in fs_charset_to_utf8()

g_error_free() was missing in case g_convert() failed.
This commit is contained in:
Max Kellermann 2008-10-31 12:20:48 +01:00
parent 8f9d9cc042
commit 71fe7ad81a

View File

@ -45,9 +45,11 @@ char *fs_charset_to_utf8(char *dst, const char *str)
p = g_convert(str, -1,
fsCharset, "utf-8",
NULL, NULL, &error);
if (p == NULL)
if (p == NULL) {
/* no fallback */
g_error_free(error);
return NULL;
}
g_strlcpy(dst, p, MPD_PATH_MAX);
g_free(p);