Fix memory leak for truncated frames