[grilo-plugins] gravatar: Don't leak GParamSpec



commit f895188c811188f3d81fa59fb4e022135b9ad4d5
Author: Jens Georg <jensg openismus com>
Date:   Tue Jul 17 11:18:53 2012 +0200

    gravatar: Don't leak GParamSpec
    
    The GParamSpecPool in the plugin registry takes a reference of the param
    spec so it needs to be unrefed in any case, not just in error.
    
    Under contract for Canonical Ltd.
    
    This fixes https://bugzilla.gnome.org/show_bug.cgi?id=680435

 src/gravatar/grl-gravatar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gravatar/grl-gravatar.c b/src/gravatar/grl-gravatar.c
index 8d4ed3b..259a2ac 100644
--- a/src/gravatar/grl-gravatar.c
+++ b/src/gravatar/grl-gravatar.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010, 2011 Igalia S.L.
+ * Copyright (C) 2012 Canonical Ltd.
  *
  * Contact: Iago Toral Quiroga <itoral igalia com>
  *
@@ -169,11 +170,11 @@ register_gravatar_key (GrlRegistry *registry,
                               G_PARAM_READWRITE);
 
   key = grl_registry_register_metadata_key (registry, spec, NULL);
+  g_param_spec_unref (spec);
 
   /* If key was not registered, could be that it is already registered. If so,
      check if type is the expected one, and reuse it */
   if (key == GRL_METADATA_KEY_INVALID) {
-    g_param_spec_unref (spec);
     key = grl_registry_lookup_metadata_key (registry, name);
     if (grl_metadata_key_get_type (key) != G_TYPE_STRING) {
       key = GRL_METADATA_KEY_INVALID;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]