[seahorse/wip/nielsdg/fix-250: 6/6] gpgpme: Photo: Don't use g_object_unref on gpgme_key_t



commit e965e3b2617afc17dbfbe754970973a266e73822
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Dec 6 08:52:03 2019 +0100

    gpgpme: Photo: Don't use g_object_unref on gpgme_key_t
    
    `gpgme_key_t` is by no chance a GObject, so don't try to call
    `g_clear_object` on it. This commit fixes a segfault.
    
    Fixes https://gitlab.gnome.org/GNOME/seahorse/issues/250

 pgp/seahorse-gpgme-photo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pgp/seahorse-gpgme-photo.c b/pgp/seahorse-gpgme-photo.c
index 8942abdf..cc85ae07 100644
--- a/pgp/seahorse-gpgme-photo.c
+++ b/pgp/seahorse-gpgme-photo.c
@@ -104,7 +104,7 @@ seahorse_gpgme_photo_finalize (GObject *gobject)
 {
        SeahorseGpgmePhoto *self = SEAHORSE_GPGME_PHOTO (gobject);
 
-       g_clear_object (&self->pubkey);
+       g_clear_pointer (&self->pubkey, gpgme_key_unref);
 
        G_OBJECT_CLASS (seahorse_gpgme_photo_parent_class)->finalize (gobject);
 }


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