sensord: fix double free problem after the allocation of memory is failed 15/71515/2
authorkibak.yoon <kibak.yoon@samsung.com>
Wed, 25 May 2016 15:15:26 +0000 (00:15 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Thu, 26 May 2016 01:54:36 +0000 (10:54 +0900)
- if the allocation of memory is failed, this function has to be finished.

Change-Id: Iea3ca9184812a82b34b3ad3bd299b2d33a382323
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/client/external_sensor_manager.cpp

index e19b403..9a0b3c4 100644 (file)
@@ -430,6 +430,7 @@ void external_sensor_manager::handle_command(sensor_id_t sensor, char* data, int
                if (!cb_info) {
                        _E("Failed to allocate memory");
                        delete[] data;
+                       return;
                }
 
                if (!get_cb_info(sensor, data, data_cnt, *cb_info)) {