Fix prevent issue 00/180000/1 accepted/tizen/unified/20180524.060223 accepted/tizen/unified/20180527.044852 submit/tizen/20180524.052210 submit/tizen/20180525.015431
authorWootak Jung <wootak.jung@samsung.com>
Thu, 24 May 2018 04:45:09 +0000 (13:45 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 24 May 2018 04:45:09 +0000 (13:45 +0900)
Change-Id: I7a2f9f1bf6b19a70e40cbf80d624d55d7eab77e5

bt-otp/bt-otpserver.c

index 80348d1ad796173644c6036ac22fabeb10a3c03d..93d3c50b656598b70b2b383e690acf7235311e89 100644 (file)
@@ -1820,6 +1820,9 @@ int _bt_otp_read_cb(const char *obj_path, char **value, int *len, uint16_t offse
 
                *len = info->value_length - offset;
                *value = (char *)malloc(sizeof(char)*(*len));
+               if (*value == NULL)
+                       return BLUETOOTH_ATT_ERROR_INTERNAL;
+
                memcpy(*value, info->char_value, *len);
 
                return BLUETOOTH_ATT_ERROR_NONE;