backport ash-Fix-use-after-free-on-idx-variable.patch
Backport of the Fix-use-after-free-on-idx-variable.patch
(#13900 (closed)) for 3.15.
Since 3.15 is used as base image, ẁe want to at least fix the problem locally with a apk upgrade
until the images are updated.