I doesn't crash in codepad.org, it runs, but the exit status of the program indicates an error. The exit status is undefined and just what happens to be on the stack by chance, and the exit value (it happens to be 120 on codepad.org) comes from your program not returning anything properly from main(), like it should do.
Traditionally in both C and C++, you had to explicitly return something from main(). In later C and C++ standards, this was changed, so that if you exited main() without a return statement, it would automatically return 0. (0 means success.)
What seems to have happened is that you have a C++ compiler which respects this standard, (standard C++ has had this rule for a longer time than standard C), that if main() is not returning anything, it returns 0 by default.
In contrast, the C compiler on codepad.org seems to follow an older standard, where main() must have an explicit return statement for the program to be valid. So, one could argue that your program fails because codepad.org does not have an up to date C compiler, or one could argue that your program should be more conservative and not assume a modern compiler, and instead return explicitly from main().
That is why the compiler on Mepis Linux warns you. It is probably not configured to follow the latest standard and thus warns you that you should end your main() function with a return statement.
So if you want to write conservative code which works everywhere, your main() function should always end with a return statement. Your very question is proof that it may be dangerous to rely on features of the newer standards if you want your code to work in the "real world".
Changing to Objective C may change something else, but the main problem (pun intended) is still that you are not explicitly returning a value from main() and what standard the C part of Objective C follows in a particular compiler.
That you are not freeing the memory, could well cause a memory leak, but is not an error in the program itself, and is not affecting the issues you observed. (Indeed, on Linux, exiting the program automatically frees all memory, which is perhaps sloppy programming, but not incorrect.)