Avoid freeing uninitialized raw_data pointer if malloc fails.