[connman] Fix memory leak in GetSavedServices.
Merge pull request #55 from lpotter/master

[connman] allow user_context to be null when queueing agent message.
Merge pull request #56 from amccarthy/master

[connman] Fix memory leak in GetSavedServices.
ipconfig: iterate safely over ipconfig_list. Fixes JB#19212

The following valgrind report appears when a network toggled from
enabled to disabled and back; it is due to ipconfig_list being
modified by functions called in the loop while iterating over the
list. When the current list element gets deleted during iteration,
g_list_next() cannot be safely called anymore.

Fixed by making a shallow copy of the list for iteration purposes.

==1638== Invalid read of size 4
==1638==    at 0x542E0: __connman_ipconfig_newlink (ipconfig.c:560)
==1638==    by 0x633F7: process_newlink (rtnl.c:445)
==1638==    by 0x6424F: netlink_event (rtnl.c:958)
==1638==    by 0x4907733: g_io_unix_dispatch (giounix.c:167)
==1638==    by 0x48AC55B: g_main_context_dispatch (gmain.c:3054)
==1638==    by 0x48AC85F: g_main_context_iterate.part.17 (gmain.c:3701)
==1638==    by 0x48ACEB3: g_main_loop_run (gmain.c:3894)
==1638==    by 0x14957: main (main.c:739)
==1638==  Address 0x50df6fc is 4 bytes inside a block of size 12 free'd
==1638==    at 0x483752C: free (vg_replace_malloc.c:446)
==1638==    by 0x48B418B: g_free (gmem.c:252)
==1638==    by 0x48A758F: g_list_remove (glist.c:480)
==1638==    by 0x55AB7: __connman_ipconfig_disable (ipconfig.c:1691)
==1638==    by 0x4376F: service_lower_down (service.c:6703)
==1638==    by 0x54373: __connman_ipconfig_newlink (ipconfig.c:575)
==1638==    by 0x633F7: process_newlink (rtnl.c:445)
==1638==    by 0x6424F: netlink_event (rtnl.c:958)
==1638==    by 0x4907733: g_io_unix_dispatch (giounix.c:167)
==1638==    by 0x48AC55B: g_main_context_dispatch (gmain.c:3054)
==1638==    by 0x48AC85F: g_main_context_iterate.part.17 (gmain.c:3701)
==1638==    by 0x48ACEB3: g_main_loop_run (gmain.c:3894)
==1638==
Merge pull request #57 from hmallat/ipconfig-safe-iteration

ipconfig: iterate safely over ipconfig_list
agent: fix agent message handling bugs.

It could happen that cleaning up a pending message in
agent_receive_message() would as a side effect zero service reference
count via driver context unref function pointer, and service cleanup
would call connman_agent_cancel() which would try to clean up the
pending message for the second time.

Fixed by decoupling the pointer to the pending request from the agent
structure before calling agent_request_free().

Also, added null message pointer handling to agent-connman.c callback
function request_input_login_reply().

[connman] Fix agent message handling bugs.
Merge pull request #58 from hmallat/dbus-agent-message-fix

agent: fix agent message handling bugs.
supplicant: rewrite pending DBus call handling

It is possible to overwrite the pending_call and pending_slot fields
in the GSupplicantInterface structure by making a new supplicant
related DBus call while an older call is still ongoing. This causes
problems with cleanup at interface removal time, as the older call is
not canceled and its reply processing may access already freed memory.

Fixed by having supplicant DBus code keep track of pending calls in a
list which is updated when call replies are processed. Supplicant code
can request cancellation of all pending calls for a particular
interface when needed.

[connman] supplicant: rewrite pending DBus call handling
Merge pull request #59 from hmallat/supplicant-dbus-call-handling-fix

supplicant: rewrite pending DBus call handling
[connman] explicitly allow dns server to be created when no services are
connected.

This allows the use of FallbackNameservers when there is no connman
connection. i.e. a usb network not handled by connman to be able to use dns