Commit 70089168 authored by Tor Lillqvist's avatar Tor Lillqvist

Check for NULL parameter in gdk_font_load. Plug a memory leak in gdkim.c.

parent 0c178e96
......@@ -54,6 +54,8 @@ gdk_font_load (const gchar *font_name)
int nHeight, nWidth, nEscapement, nOrientation, fnWeight;
int logpixelsy;
g_return_val_if_fail (font_name != NULL, NULL);
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
......
......@@ -54,6 +54,8 @@ gdk_font_load (const gchar *font_name)
int nHeight, nWidth, nEscapement, nOrientation, fnWeight;
int logpixelsy;
g_return_val_if_fail (font_name != NULL, NULL);
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
......
......@@ -186,7 +186,6 @@ gdk_wcstombs (const GdkWChar *src)
}
mbstr[mbsl] = '\0';
g_free (src_alt);
return mbstr;
}
else
{
......@@ -233,6 +232,7 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
wcsl = dest_max;
for (i = 0; i < wcsl; i++)
dest[i] = wcstr[i];
g_free (wcstr);
return wcsl;
}
......
......@@ -186,7 +186,6 @@ gdk_wcstombs (const GdkWChar *src)
}
mbstr[mbsl] = '\0';
g_free (src_alt);
return mbstr;
}
else
{
......@@ -233,6 +232,7 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
wcsl = dest_max;
for (i = 0; i < wcsl; i++)
dest[i] = wcstr[i];
g_free (wcstr);
return wcsl;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment