Merge "Fix potential linear alloc memory leak"