Plug a memory leak

Do not evaluate a macro argument multiple times if it gets passed an
expression, especially if that expression allocates memory.

Thanks to Pavel Roschin for spotting the leak.
Plug a memory leak

Thanks to Pavel Roschin for spotting it.
Fix some module-specific globals not declared static

This prevents the symbol to be exported and possibly conflict with
another one.