diff options
author | Jens Georg <mail@jensge.org> | 2020-07-25 21:20:01 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2020-07-29 22:44:37 +0200 |
commit | 71c6fd0fe63290c2766010b67ac0e7cac45b8304 (patch) | |
tree | 988d35eaccc1e671788b4c45ef0b8bda071ed61a | |
parent | 0ed37b3d70eef65723ae8560289a5d5b62e26cc0 (diff) | |
download | gupnp-tools-71c6fd0fe63290c2766010b67ac0e7cac45b8304.tar.gz |
network-light: Fix some memory leaks
-rw-r--r-- | src/network-light/main.c | 4 | ||||
-rw-r--r-- | src/network-light/upnp.c | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/network-light/main.c b/src/network-light/main.c index 5d535a2..7cb1eb0 100644 --- a/src/network-light/main.c +++ b/src/network-light/main.c @@ -108,9 +108,13 @@ main (int argc, char **argv) if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print (_("Could not parse options: %s\n"), error->message); + g_option_context_free (context); + return -4; } + g_option_context_free (context); + if (!init_ui (&argc, &argv, name, exclusive)) { return -1; } diff --git a/src/network-light/upnp.c b/src/network-light/upnp.c index 1b5dadf..193eba5 100644 --- a/src/network-light/upnp.c +++ b/src/network-light/upnp.c @@ -158,6 +158,8 @@ notify_status_change (gboolean status) status, NULL); } + + g_list_free (network_lights); } void @@ -179,6 +181,8 @@ notify_load_level_change (gint load_level) load_level, NULL); } + + g_list_free (network_lights); } G_MODULE_EXPORT @@ -481,7 +485,7 @@ set_all_status (gboolean status) action, NULL, on_service_proxy_action_ret, - NULL); + action_name); gupnp_service_proxy_action_unref (action); } } @@ -584,11 +588,15 @@ on_network_light_unavailable (GUPnPControlPoint *control_point, remove_service_from_list (info, &switch_proxies); } + g_clear_object (&info); + info = gupnp_device_info_get_service (GUPNP_DEVICE_INFO (light_proxy), DIMMING_SERVICE); if (info) { remove_service_from_list (info, &dimming_proxies); } + + g_clear_object (&info); } static gboolean |