The `glob()` functions may cause a double-free of the same heap block when a memory allocation fails during the process of prepending directory names to matched names. This occurs because names already rewritten are freed, but their pointers remain in the result vector, leading the error path to free them again using `globfree()`. This condition is typically reachable when a process is near its memory limit, such as on 32-bit systems or under an address space limit (`RLIMIT AS`). An attacker could trigger this by controlling the glob pattern and leveraging knowledge of the filesystem layout to force the program to run out of memory. This issue affects all supported architectures and ABIs.