h->current_scan_status = malloc(sizeof(scanstatus));
h->current_metadata = malloc(sizeof(metadata));
h->read_info = malloc(sizeof(readinfo));
+ h->image = malloc(sizeof(imagedata));
h->sessionid = 0;
h->state = NOTCONNECTED;
h->read_info->read_size = 0;
h->read_info->readed_bytes_per_line = 0;
h->read_info->readed_lines = 0;
+ h->image->size = 0;
+ h->image->data = NULL;
return h;
}
h->current_metadata = NULL;
free(h->read_info);
h->read_info = NULL;
+ free(h->image->data);
+ h->image->data = NULL;
+ free(h->image);
+ h->image = NULL;
free(h);
h = NULL;
}