Merge "Merge "Fix potential memory leaks" am: dfc66d0a29" into main-16k