Fix incorrect memory validation for g_malloc*() 99/100699/1
authorSyam <s.syam@samsung.com>
Mon, 28 Nov 2016 08:32:47 +0000 (17:32 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 29 Nov 2016 04:21:48 +0000 (13:21 +0900)
commitdd7a9d268c53b1ce24b70467cc82a5f188acdd77
treeb296486b4f5b2179bf7e740ef82d292e8652f83b
parentebf6c718979c3fea4040b338154b1eb3b5c28f96
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: If61ac9d2628ce9432b767d588f991ca4c625fcf6
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]