here you have to check if data_descriptor is not null and release it, it's always good to release within the error handling, cause if program enters here it most probably means that you're out of memory but data may have been partially initialized, so it's good to check every possibility and to release what has been allocated so far.