Add README
[tilda-gobject.git] / tilda-config.c
index 6563312..54a3d50 100644 (file)
@@ -190,7 +190,7 @@ tilda_controller_set_property_from_config (TildaController *self, const gchar *p
        gboolean ret;
 
        GParamSpec *pspec;
-       GValue *value = g_malloc0(sizeof(GValue));
+       GValue *value = g_new0 (GValue, 1);
        gboolean (*parse_func) (GKeyFile *keyfile, const gchar *group_name, const gchar *key, GValue *value, GError **error);
 
        /* Get the pspec for this property */
@@ -270,6 +270,7 @@ tilda_controller_set_property_from_config (TildaController *self, const gchar *p
 
 //failure:
        g_critical (_("Unable to find a value for controller property: %s\n"), property);
+       g_free (value);
        return FALSE;
 
 success:
@@ -290,7 +291,7 @@ tilda_window_set_property_from_config (TildaWindow *self, const gchar *property)
        gboolean ret;
 
        GParamSpec *pspec;
-       GValue *value = g_malloc0(sizeof(GValue));
+       GValue *value = g_new0(GValue, 1);
        gboolean (*parse_func) (GKeyFile *keyfile, const gchar *group_name, const gchar *key, GValue *value, GError **error);
 
        /* Get the pspec for this property */
@@ -372,6 +373,7 @@ tilda_window_set_property_from_config (TildaWindow *self, const gchar *property)
 
 //failure:
        g_critical (_("Unable to find a value for window property: %s\n"), property);
+       g_free (value);
        return FALSE;
 
 success:
@@ -393,7 +395,7 @@ tilda_terminal_set_property_from_config (TildaTerminal *self, const gchar *prope
        gboolean ret;
 
        GParamSpec *pspec;
-       GValue *value = g_malloc0(sizeof(GValue));
+       GValue *value = g_new0 (GValue, 1);
        gboolean (*parse_func) (GKeyFile *keyfile, const gchar *group_name, const gchar *key, GValue *value, GError **error);
 
        /* Get the pspec for this property */
@@ -490,6 +492,7 @@ tilda_terminal_set_property_from_config (TildaTerminal *self, const gchar *prope
 
 //failure:
        g_critical (_("Unable to find a value for terminal property: %s\n"), property);
+       g_free (value);
        return FALSE;
 
 success: