Fix incorrect memory validation for g_malloc*() 68/100468/2
authorSyam <s.syam@samsung.com>
Mon, 28 Nov 2016 08:32:47 +0000 (17:32 +0900)
committerInjun Yang <injun.yang@samsung.com>
Mon, 28 Nov 2016 10:13:19 +0000 (19:13 +0900)
commita83df457704d47bd8da6682649ef92fff2b72028
treefb86ae77e5b1b952a23918afebe275e5a98629c5
parent14e8fd27edb3be690618b34d6b44274c76f0a2a9
Fix incorrect memory validation for g_malloc*()

g_malloc*() will always return a valid memory address. If the
device is in out of memory case, g_malloc*() will assert.
Hence no need to validate the return value against NULL.

g_malloc*() will always return a memory address which is of type void *.
It doesn't make any sense to typecast this return address to another
pointer address. Ex: char *p = (char *)g_malloc0(..);

Change-Id: I84e772ea2879f2e00a9232922638e19075fd1c7f
Signed-off-by: Injun Yang <injun.yang@samsung.com>
17 files changed:
bt-api/bt-audio.c
bt-api/bt-event-handler.c
bt-api/bt-gatt-client.c
bt-api/bt-hid-device.c
bt-service-emul/bt-service-event-manager.c
bt-service-emul/bt-service-util.c
bt-service/bt-service-adapter-le.c
bt-service/bt-service-agent.c
bt-service/bt-service-audio.c
bt-service/bt-service-device.c
bt-service/bt-service-event-receiver.c
bt-service/bt-service-gap-agent.c
bt-service/bt-service-hid.c
bt-service/bt-service-network.c
bt-service/bt-service-opp-client.c
bt-service/bt-service-util.c [changed mode: 0755->0644]
test/gatt-test/bluetooth-gatt-test.c [changed mode: 0755->0644]