File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -311,7 +311,11 @@ int aws_mqtt_iot_sdk_metrics_storage_init(
311311 return AWS_OP_SUCCESS ;
312312
313313metrics_storage_error :
314- aws_mqtt_iot_sdk_metrics_storage_clean_up (metrics_storage );
314+ if (aws_array_list_is_valid (& metrics_storage -> metadata_entries )) {
315+ aws_array_list_clean_up (& metrics_storage -> metadata_entries );
316+ }
317+ aws_byte_buf_clean_up (& metrics_storage -> storage );
318+
315319 return AWS_OP_ERR ;
316320}
317321
@@ -320,7 +324,9 @@ void aws_mqtt_iot_sdk_metrics_storage_clean_up(struct aws_mqtt_iot_sdk_metrics_s
320324 return ;
321325 }
322326
323- aws_array_list_clean_up (& metrics_storage -> metadata_entries );
327+ if (aws_array_list_is_valid (& metrics_storage -> metadata_entries )) {
328+ aws_array_list_clean_up (& metrics_storage -> metadata_entries );
329+ }
324330 aws_byte_buf_clean_up (& metrics_storage -> storage );
325331
326332 aws_mem_release (metrics_storage -> allocator , & metrics_storage );
You can’t perform that action at this time.
0 commit comments