[gtk/wip/baedert/for-master: 78/82] shorthandproperty: Use alloc a for data array
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 78/82] shorthandproperty: Use alloc a for data array
- Date: Sat, 25 Apr 2020 13:01:04 +0000 (UTC)
commit 1cddc3719d6426d0e6bf194d8ec7cb97d109a80d
Author: Timm Bäder <mail baedert org>
Date: Sat Apr 18 10:54:44 2020 +0200
shorthandproperty: Use alloc a for data array
gtk/gtkcssshorthandproperty.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcssshorthandproperty.c b/gtk/gtkcssshorthandproperty.c
index c33bbe449f..50ef48e928 100644
--- a/gtk/gtkcssshorthandproperty.c
+++ b/gtk/gtkcssshorthandproperty.c
@@ -71,7 +71,8 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
GtkCssValue *result;
guint i;
- data = g_new0 (GtkCssValue *, shorthand->subproperties->len);
+ data = g_newa (GtkCssValue *, shorthand->subproperties->len);
+ memset (data, 0, sizeof (GtkCssValue *) * shorthand->subproperties->len);
if (gtk_css_parser_try_ident (parser, "initial"))
{
@@ -114,7 +115,6 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
if (data[i] != NULL)
_gtk_css_value_unref (data[i]);
}
- g_free (data);
return NULL;
}
@@ -128,8 +128,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
}
result = _gtk_css_array_value_new_from_array (data, shorthand->subproperties->len);
- g_free (data);
-
+
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]