[balsa] address: Do not leak vcard string



commit 90bbc9bc74b0fe72d7b8669c8f3969db577e5cd2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Feb 18 13:30:22 2019 -0500

    address: Do not leak vcard string
    
            * libbalsa/address.c (libbalsa_address_new_from_vcard): do not
            leak a string.

 ChangeLog          | 5 +++++
 libbalsa/address.c | 4 ++++
 2 files changed, 9 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index 85d1b2f00..577a20174 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * libbalsa/address.c (libbalsa_address_new_from_vcard): do not
+       leak a string.
+
 2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Cast weak-pointer-location to (gpointer *) in calls to
diff --git a/libbalsa/address.c b/libbalsa/address.c
index d1a7e2553..c0e58f878 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -409,6 +409,8 @@ libbalsa_address_new_from_vcard(const gchar *str, const gchar *charset)
                 address->organization = org;
                 address->address_list = g_list_reverse(address_list);
 
+                g_free(vcard);
+
                 return address;
             }
 
@@ -516,6 +518,8 @@ libbalsa_address_new_from_vcard(const gchar *str, const gchar *charset)
     g_list_foreach(address_list, (GFunc) g_free, NULL);
     g_list_free(address_list);
 
+    g_free(vcard);
+
     return NULL;
 }
 


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