Fix possible allocation of 0 len buffer in rtc