bluez/audio
Anderson Lizardo cb40056ccd audio: Fix memory leak when headset server probe() fails
If RFCOMM is disabled on the kernel, headset_server_probe() fails.
Relevant log messages:

 audio/manager.c:headset_server_probe() path /org/bluez/499/hci0
 src/adapter.c:btd_adapter_ref() 0x4bb4f78: ref=6
 audio/manager.c:audio_adapter_ref() 0x4ca3010: ref=1
 socket(STREAM, RFCOMM): Protocol not supported (93)
 audio/manager.c:audio_adapter_unref() 0x4ca3010: ref=0
 src/adapter.c:btd_adapter_unref() 0x4bb4f78: ref=5
 audio-headset: Operation not permitted (1)

The powered callback should only be registered if adapter driver probe
was successful. The callback unregister was moved to the beginning of
headset_server_remove() for consistency.

This fixes this memory leak:

==499== 8 bytes in 1 blocks are definitely lost in loss record 44 of 182
==499==    at 0x4826444: malloc (vg_replace_malloc.c:263)
==499==    by 0x4877243: g_malloc (gmem.c:132)
==499==    by 0x488D088: g_slice_alloc (gslice.c:836)
==499==    by 0x488E8A5: g_slist_append (gslist.c:230)
==499==    by 0x18AEEE: btd_adapter_register_powered_callback
(adapter.c:3416)
==499==    by 0x11AF61: headset_server_probe (manager.c:919)
==499==    by 0x18B67B: probe_driver (adapter.c:2033)
==499==    by 0x1908F5: adapter_init (adapter.c:2048)
==499==    by 0x189D20: btd_manager_register_adapter (manager.c:397)
==499==    by 0x1649AF: mgmt_cmd_complete (mgmtops.c:1075)
==499==    by 0x16665E: mgmt_event (mgmtops.c:1780)
==499==    by 0x48B2EFA: g_io_unix_dispatch (giounix.c:162)
2012-04-12 14:36:34 +03:00
..
a2dp-codecs.h audio: Update license for shared header files 2011-08-26 11:18:54 -07:00
a2dp.c a2dp: return NotSupported error if no server found 2012-02-14 12:47:57 +02:00
a2dp.h a2dp: update copyright statement 2011-11-21 12:57:56 +02:00
audio.conf Fix common spelling error in code and comments 2012-03-30 13:10:11 +03:00
avctp.c AVRCP: Fix response length for Subunit Info command 2012-04-05 12:52:27 +03:00
avctp.h AVRCP: limit AVRCP packet size to the MTU of AV/C 2011-09-27 13:11:35 +03:00
avdtp.c avdtp: fix audio source init check 2012-03-27 14:51:43 +03:00
avdtp.h Reuse same SEP when reconfiguring A2DP streams 2011-02-08 11:04:39 -08:00
avrcp.c avrcp: Add error code for rejected vendor command 2012-03-13 13:50:19 +02:00
avrcp.h avrcp: Add error code for rejected vendor command 2012-03-13 13:50:19 +02:00
bluetooth.conf Replace asound.conf with a more full-fledged bluetooth.conf 2009-04-17 01:45:19 +02:00
control.c AVRCP: move handling of vendor dependent PDU from control.c to avrcp.c 2011-09-13 10:44:56 +03:00
control.h AVRCP: move handling of vendor dependent PDU from control.c to avrcp.c 2011-09-13 10:44:56 +03:00
ctl_bluetooth.c audio: Fix errno handling convention 2011-11-17 13:57:52 +02:00
device.c AVRCP: move MediaPlayer to adapter object 2011-10-06 11:13:28 +03:00
device.h AVRCP: move MediaPlayer to adapter object 2011-10-06 11:13:28 +03:00
gateway.c gateway: Fix crash if SCO connection fails 2012-03-08 17:58:18 -06:00
gateway.h Check all states before allowing gw connection 2011-09-24 13:12:00 +03:00
gsta2dpsink.c audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gsta2dpsink.h audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gstavdtpsink.c AVDTP: Fix closing invalid FD on error 2011-11-18 13:24:22 +02:00
gstavdtpsink.h audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gstbluetooth.c audio: fix memory leak with typefinding 2010-06-29 10:29:10 +03:00
gstpragma.h Fix C++ style comments 2011-05-10 17:17:03 +02:00
gstrtpsbcpay.c Add pragma based workaround for GStreamer warnings 2010-05-19 16:59:30 +02:00
gstrtpsbcpay.h audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gstsbcdec.c Add pragma based workaround for GStreamer warnings 2010-05-19 16:59:30 +02:00
gstsbcdec.h audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gstsbcenc.c Add pragma based workaround for GStreamer warnings 2010-05-19 16:59:30 +02:00
gstsbcenc.h audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gstsbcparse.c Add pragma based workaround for GStreamer warnings 2010-05-19 16:59:30 +02:00
gstsbcparse.h audio: Remove workaround for compiler warnings 2011-02-13 17:51:45 -08:00
gstsbcutil.c Fix common misspelled words 2011-07-03 14:36:14 +03:00
gstsbcutil.h Update copyright information 2010-01-01 17:08:17 -08:00
headset.c Fix common spelling error in code and comments 2012-03-30 13:10:11 +03:00
headset.h Fix get/set_hfp_active to match name conventions 2011-08-22 11:04:24 +03:00
ipc.c audio/IPC: Fix errno handling convention 2011-11-17 13:57:52 +02:00
ipc.h audio: Update license for shared header files 2011-08-26 11:18:54 -07:00
main.c Fix get/set_hfp_active to match name conventions 2011-08-22 11:04:24 +03:00
manager.c audio: Fix memory leak when headset server probe() fails 2012-04-12 14:36:34 +03:00
manager.h avrcp: add skeleton of MediaPlayer interface 2011-08-12 11:04:29 +03:00
media.c Fix GLib assertion failure in media.c get_setting() 2012-02-02 15:56:42 -08:00
media.h Fix possible invalid read/free on media.c 2011-08-08 16:47:02 +03:00
pcm_bluetooth.c Fix return value check for bt_audio_service_open() 2011-11-17 13:57:53 +02:00
rtp.h Update copyright information 2010-01-01 17:08:17 -08:00
sink.c audio: Fix clang compiler warnings regarding implicit enum conversion 2012-02-14 14:30:20 +02:00
sink.h audio: Fix clang compiler warnings regarding implicit enum conversion 2012-02-14 14:30:20 +02:00
source.c audio: Fix clang compiler warnings regarding implicit enum conversion 2012-02-14 14:30:20 +02:00
source.h audio: Fix clang compiler warnings regarding implicit enum conversion 2012-02-14 14:30:20 +02:00
telephony-dummy.c Fix cleaning up HFP state after calling telephony_exit 2010-12-12 23:06:16 +02:00
telephony-maemo5.c Fix spelling errors 2012-04-04 13:03:54 +03:00
telephony-maemo6.c Fix spelling errors 2012-04-04 13:03:54 +03:00
telephony-ofono.c Add glib-compat.h to deal with issues in old GLib versions 2011-10-18 10:57:06 +03:00
telephony.h Fix cleaning up HFP state after calling telephony_exit 2010-12-12 23:06:16 +02:00
transport.c media: register disconnect watch at transport add 2012-03-08 17:58:18 -06:00
transport.h Fix headset state callback in Media API 2011-07-10 10:57:17 +03:00
unix.c Fix spelling errors 2012-04-04 13:03:54 +03:00
unix.h Update Nokia copyrights 2010-01-07 01:11:05 -08:00