[gssdp] SocketSource: Small code clean-up



commit b5ed6be7afa44102cb0484106af2fa5676e51d68
Author: Jens Georg <mail jensge org>
Date:   Thu Oct 28 17:45:51 2021 +0200

    SocketSource: Small code clean-up

 libgssdp/gssdp-socket-source.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/libgssdp/gssdp-socket-source.c b/libgssdp/gssdp-socket-source.c
index 438ca82..6cb0a66 100644
--- a/libgssdp/gssdp-socket-source.c
+++ b/libgssdp/gssdp-socket-source.c
@@ -345,10 +345,9 @@ gssdp_socket_source_do_init (GInitable                   *initable,
         success = TRUE;
 
 error:
-        if (bind_address != NULL)
-                g_object_unref (bind_address);
-        if (group != NULL)
-                g_object_unref (group);
+        g_clear_object (&bind_address);
+        g_clear_object (&group);
+
         if (!success)
                 /* Be aware that inner_error has already been free'd by
                  * g_propagate_error(), so we cannot access its contents


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