[PATCH 5.16 123/227] libsubcmd: Fix use-after-free for realloc(..., 0)