Fixed invalid read due to short alloc