2019-12-03 09:49:29

by Syam Sidhardhan

[permalink] [raw]
Subject: [PATCH 1/1] client: Fix memory leak

---
client/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/main.c b/client/main.c
index 68dabda..8bd0bac 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1792,11 +1792,11 @@ static void remove_device(GDBusProxy *proxy)
{
char *path;

- path = g_strdup(g_dbus_proxy_get_path(proxy));
-
if (!default_ctrl)
return;

+ path = g_strdup(g_dbus_proxy_get_path(proxy));
+
if (g_dbus_proxy_method_call(default_ctrl->proxy, "RemoveDevice",
remove_device_setup,
remove_device_reply,
--
2.7.4


2019-12-08 04:14:15

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH 1/1] client: Fix memory leak

Hi Syam,

On Tue, Dec 3, 2019 at 11:51 AM Syam Sidhardhan <[email protected]> wrote:
>
> ---
> client/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/client/main.c b/client/main.c
> index 68dabda..8bd0bac 100644
> --- a/client/main.c
> +++ b/client/main.c
> @@ -1792,11 +1792,11 @@ static void remove_device(GDBusProxy *proxy)
> {
> char *path;
>
> - path = g_strdup(g_dbus_proxy_get_path(proxy));
> -
> if (!default_ctrl)
> return;
>
> + path = g_strdup(g_dbus_proxy_get_path(proxy));
> +
> if (g_dbus_proxy_method_call(default_ctrl->proxy, "RemoveDevice",
> remove_device_setup,
> remove_device_reply,
> --
> 2.7.4

Applied, thanks.

--
Luiz Augusto von Dentz