[PATCH memleak service 0/3] Memory leak fixes in service

2011-01-05 Thread Jukka Rissanen
Hi again,

while doing IPv6 work I found some more memory leak problems.

The patch 1 is optional as it just adds some more debug output
in ipconfig ref/unref functions but I needed it to find the
problem described in second patch.

The patch 2 fixes reference counting issue in service.c file.
The IPv4 and IPv6 ipconfig structs are created in service.c and
the reference count is set to 1 at the beginning. The service.c
also calls __connman_ipconfig_enable() which increments ref count
to 2. At some point the __connman_ipconfig_disable() is called which
then decrements the ref count to 1 and then incorrectly clears ipconfig.
The patch unrefs the ipconfig correctly before setting ipconfig to NULL.

The patch 3 frees the IPv6 gateway address as it was never done.


Regards,

Jukka


Jukka Rissanen (3):
  ipconfig: add debugging to ref counting functions
  memoryleak: ipconfig was not unreferenced properly
  memoryleak: IPv6 gateway was not freed

 src/connection.c |1 +
 src/ipconfig.c   |   12 ++--
 src/service.c|   34 ++
 3 files changed, 33 insertions(+), 14 deletions(-)

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH memleak service 0/3] Memory leak fixes in service

2011-01-05 Thread Marcel Holtmann
Hi Jukka,

 while doing IPv6 work I found some more memory leak problems.
 
 The patch 1 is optional as it just adds some more debug output
 in ipconfig ref/unref functions but I needed it to find the
 problem described in second patch.
 
 The patch 2 fixes reference counting issue in service.c file.
 The IPv4 and IPv6 ipconfig structs are created in service.c and
 the reference count is set to 1 at the beginning. The service.c
 also calls __connman_ipconfig_enable() which increments ref count
 to 2. At some point the __connman_ipconfig_disable() is called which
 then decrements the ref count to 1 and then incorrectly clears ipconfig.
 The patch unrefs the ipconfig correctly before setting ipconfig to NULL.
 
 The patch 3 frees the IPv6 gateway address as it was never done.

all three patches have been applied. Thanks.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman