Merge pull request #8619 from davidhorstmann-arm/fix-selftest-doublefree

Fix potential double-free in calloc selftest