[glib] gio: Fix a GError memory leak in GNetworkService



commit db972a73ce016afb9561be2677547efdb649274b
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Mar 15 18:08:29 2016 +0000

    gio: Fix a GError memory leak in GNetworkService
    
    Spotted by Coverity (CID: #1325405).

 gio/gnetworkservice.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gio/gnetworkservice.c b/gio/gnetworkservice.c
index d759819..57c8e8f 100644
--- a/gio/gnetworkservice.c
+++ b/gio/gnetworkservice.c
@@ -480,6 +480,8 @@ g_network_service_address_enumerator_next (GSocketAddressEnumerator  *enumerator
             {
               if (srv_enum->error == NULL)
                 srv_enum->error = error;
+              else
+                g_error_free (error);
               continue;
             }
 


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