Skip to content

Commit 48e5f17

Browse files
authored
fix(zigbee_ep): replace nullptr by NULL after C malloc()
1 parent a7c7713 commit 48e5f17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/Zigbee/src/ZigbeeEP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute) {
251251
if (attribute->id == ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING && attribute->data.value) {
252252
zbstring_t *zbstr = (zbstring_t *)attribute->data.value;
253253
char *_read_manufacturer = (char *) malloc(zbstr->len + 1);
254-
if (_read_manufacturer == nullptr) {
254+
if (_read_manufacturer == NULL) {
255255
log_e("Failed to allocate memory for manufacturer data");
256256
xSemaphoreGive(lock);
257257
return;
@@ -264,7 +264,7 @@ void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute) {
264264
if (attribute->id == ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING && attribute->data.value) {
265265
zbstring_t *zbstr = (zbstring_t *)attribute->data.value;
266266
char *_read_model = (char *) malloc(zbstr->len + 1);
267-
if (_read_model == nullptr) {
267+
if (_read_model == NULL) {
268268
log_e("Failed to allocate memory for model data");
269269
xSemaphoreGive(lock);
270270
return;

0 commit comments

Comments
 (0)