If you ever get this fun error while trying to exit or shell a program with DJGPP:
combinelo: memory fouled
free: memory fouled
You are mixing libraries built with a different version of the DJGPP runtime. In my case, I built the allegro library with GCC 18.104.22.168 to use the older binutils but I’m cross compiling with GCC 5, so it’s using the newer runtime.
In my case I just needed to replace the contents of the lib directory with djcrx202.zip, and I was good to go. I guess I could re-compile allegro, but that takes the better part of forever on DOSBox, and once was good enough.