Fix a segmentation fault error when calling read_attribute_req API