From: saerome.kim Date: Thu, 2 Aug 2018 01:02:55 +0000 (+0900) Subject: Made memory allocated at runtime to NULL explicetly. X-Git-Tag: submit/tizen/20180808.034959~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eef0f3543d77d187a8d364ab2486bec743305dd4;p=platform%2Fcore%2Fapi%2Fzigbee.git Made memory allocated at runtime to NULL explicetly. Change-Id: I42bff55ef4cb677f85b849c623521e08c66fbf6a Signed-off-by: saerome.kim --- diff --git a/src/zbl-zcl.c b/src/zbl-zcl.c index 6322a98..3c0f845 100644 --- a/src/zbl-zcl.c +++ b/src/zbl-zcl.c @@ -84,9 +84,12 @@ API int zb_read_attr_status_record_destroy( CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); - if (h->value) + if (h->value) { free(h->value); + h->value = NULL; + } free(h); + h = NULL; return ZIGBEE_ERROR_NONE; } @@ -298,6 +301,7 @@ API int zb_discover_attr_info_destroy(zb_zcl_discover_attr_info_record_h handle) RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); free(h); + h = NULL; return ZIGBEE_ERROR_NONE; } @@ -637,9 +641,12 @@ API int zb_report_config_record_destroy(zb_zcl_reporting_config_record_h handle) CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); - if (h->change) + if (h->change) { free(h->change); + h->change = NULL; + } free(h); + h = NULL; return ZIGBEE_ERROR_NONE; } @@ -886,6 +893,7 @@ API int zb_read_report_config_record_destroy( RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); free(h); + h = NULL; return ZIGBEE_ERROR_NONE; } @@ -984,6 +992,7 @@ API int zb_report_config_response_record_destroy( RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); free(h); + h = NULL; return ZIGBEE_ERROR_NONE; } @@ -1113,9 +1122,12 @@ API int zb_attr_report_destroy(zb_zcl_attr_report_h handle) CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); - if (h->value) + if (h->value) { free(h->value); + h->value = NULL; + } free(h); + h = NULL; return ZIGBEE_ERROR_NONE; } @@ -1359,6 +1371,7 @@ API int zb_extended_attr_info_destroy(zb_zcl_extended_attr_info_h handle) RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER); free(h); + h = NULL; return ZIGBEE_ERROR_NONE; }