diff options
author | Jason Conti <jason.conti@gmail.com> | 2015-10-23 17:51:59 -0400 |
---|---|---|
committer | Jason Conti <jason.conti@gmail.com> | 2015-10-23 17:51:59 -0400 |
commit | 8fe20cef1a0b3838047e4ae7f3bc0893323af4f2 (patch) | |
tree | 3dad0bae27331868a524410a98a7469d98034e9f /src/notification.c | |
parent | 32a2a7adf0b651a25f98f576a6657707507df5ec (diff) | |
download | ayatana-indicator-notifications-8fe20cef1a0b3838047e4ae7f3bc0893323af4f2.tar.gz ayatana-indicator-notifications-8fe20cef1a0b3838047e4ae7f3bc0893323af4f2.tar.bz2 ayatana-indicator-notifications-8fe20cef1a0b3838047e4ae7f3bc0893323af4f2.zip |
* Fix a serious memory leak in notification_new_from_dbus_message.
* Bump version.
Diffstat (limited to 'src/notification.c')
-rw-r--r-- | src/notification.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/notification.c b/src/notification.c index b75679d..a4868a3 100644 --- a/src/notification.c +++ b/src/notification.c @@ -106,17 +106,20 @@ notification_new_from_dbus_message(GDBusMessage *message) g_assert(g_variant_is_of_type(child, G_VARIANT_TYPE_STRING)); self->priv->app_name = g_variant_dup_string(child, &(self->priv->app_name_length)); + g_variant_unref(child); /* replaces_id */ child = g_variant_get_child_value(body, COLUMN_REPLACES_ID); g_assert(g_variant_is_of_type(child, G_VARIANT_TYPE_UINT32)); self->priv->replaces_id = g_variant_get_uint32(child); + g_variant_unref(child); /* app_icon */ child = g_variant_get_child_value(body, COLUMN_APP_ICON); g_assert(g_variant_is_of_type(child, G_VARIANT_TYPE_STRING)); self->priv->app_icon = g_variant_dup_string(child, &(self->priv->app_icon_length)); + g_variant_unref(child); /* summary */ child = g_variant_get_child_value(body, COLUMN_SUMMARY); @@ -125,6 +128,7 @@ notification_new_from_dbus_message(GDBusMessage *message) &(self->priv->summary_length)); g_strstrip(self->priv->summary); self->priv->summary_length = strlen(self->priv->summary); + g_variant_unref(child); /* body */ child = g_variant_get_child_value(body, COLUMN_BODY); @@ -133,6 +137,7 @@ notification_new_from_dbus_message(GDBusMessage *message) &(self->priv->body_length)); g_strstrip(self->priv->body); self->priv->body_length = strlen(self->priv->body); + g_variant_unref(child); /* hints */ child = g_variant_get_child_value(body, COLUMN_HINTS); @@ -142,6 +147,8 @@ notification_new_from_dbus_message(GDBusMessage *message) value = g_variant_lookup_value(child, X_CANONICAL_PRIVATE_SYNCHRONOUS, G_VARIANT_TYPE_STRING); if(value != NULL) { const gchar *private_string = g_variant_get_string(value, NULL); + g_variant_unref(value); + value = NULL; if((g_strcmp0(private_string, "volume") == 0) || (g_strcmp0(private_string, "brightness") == 0) || @@ -150,6 +157,7 @@ notification_new_from_dbus_message(GDBusMessage *message) } } + g_variant_unref(child); child = NULL; return self; |