_read_json(const char *path)
{
char *buffer, *type;
- json_object *root_obj, *data_obj, *frame_obj, *frame_data_obj, *led_obj, *led_data_obj;
+ json_object *root_obj = NULL, *data_obj, *frame_obj, *frame_data_obj, *led_obj, *led_data_obj;
default_ani_info *ani_info = NULL;
int frame_id = 0, frame_len = 0, led_id = 0, led_len = 0;
int data_size = 0, i, j;
}
}
+ json_object_put(root_obj);
free(buffer);
return ani_info;
error:
+ if (root_obj) json_object_put(root_obj);
if (buffer) free(buffer);
if (ani_info) {
if (ani_info->frames) {