[gssdp/gssdp_1.0] sniffer: Plug memory leak when looking for hosts



commit 27632ae0a60e25a7873187326ddecb57bb275ca9
Author: Jens Georg <mail jensge org>
Date:   Wed Oct 31 16:20:45 2018 +0100

    sniffer: Plug memory leak when looking for hosts

 tools/gssdp-device-sniffer.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/tools/gssdp-device-sniffer.c b/tools/gssdp-device-sniffer.c
index 0a16bc5..fff5845 100644
--- a/tools/gssdp-device-sniffer.c
+++ b/tools/gssdp-device-sniffer.c
@@ -286,12 +286,11 @@ find_device (GtkTreeModel *model, const char *uuid, GtkTreeIter *iter)
                 gtk_tree_model_get (model,
                                 iter, 
                                 0, &device_uuid, -1);
-                if (device_uuid && strcmp (device_uuid, uuid) == 0) {
-                        found = TRUE;
-                        break;
-                }
-
+                found = g_strcmp0 (device_uuid, uuid) == 0;
                 g_free (device_uuid);
+
+                if (found)
+                        break;
                 more = gtk_tree_model_iter_next (model, iter);
         }
 


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