Re: [PATCH] counter: fix possible memory leak

2015-01-30 Thread Patrik Flykt
On Thu, 2015-01-08 at 23:56 +0200, pasi.sjoh...@jolla.com wrote:
 From: Pasi Sjöholm pasi.sjoh...@jollamobile.com
 
 DBusMessage message leaks memory if not cleaned when
 counter is not found.

Applied, thanks!

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: [PATCH] counter: fix possible memory leak

2015-01-28 Thread Pasi Sjöholm

Hi,

Patrik, you have probably missed this one?-)

Br,
Pasi

On 08.01.2015 23:56, pasi.sjoh...@jolla.com wrote:

From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

DBusMessage message leaks memory if not cleaned when
counter is not found.
---
  src/counter.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/counter.c b/src/counter.c
index 06e5daf..8ea6205 100644
--- a/src/counter.c
+++ b/src/counter.c
@@ -133,8 +133,11 @@ void __connman_counter_send_usage(const char *path,
struct connman_counter *counter;

counter = g_hash_table_lookup(counter_table, path);
-   if (!counter)
+   if (!counter) {
+   if (message)
+   dbus_message_unref(message);
return;
+   }

dbus_message_set_destination(message, counter-owner);
dbus_message_set_path(message, counter-path);


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman