Hi,
running ./shortcut.sh makes the program crash. Below you find a valgrind log. I run Ubuntu hardy..
==4963== Memcheck, a memory error detector.
==4963== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==4963== Using LibVEX rev 1804, a library for dynamic binary translation.
==4963== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==4963== Using valgrind-3.3.0-Debian, a dynamic binary instrumentation framework.
==4963== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==4963== For more details, rerun with: -v
==4963==
==4963== Invalid write of size 4
==4963== at 0x80522A4: wLiteralAddNum (literal.c:59)
==4963== by 0x8052485: wLiteralInit (literal.c:168)
==4963== by 0x8065315: wMainInterpret (main.c:483)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x44759e0 is 4 bytes after a block of size 4 alloc'd
==4963== at 0x4021BDE: calloc (vg_replace_malloc.c:397)
==4963== by 0x8049DA0: wMalloc (mem.c:153)
==4963== by 0x8052291: wLiteralAddNum (literal.c:57)
==4963== by 0x8052485: wLiteralInit (literal.c:168)
==4963== by 0x8065315: wMainInterpret (main.c:483)
==4963== by 0x80654C8: main (main.c:574)
==4963==
==4963== Invalid write of size 4
==4963== at 0x80522A4: wLiteralAddNum (literal.c:59)
==4963== by 0x805249A: wLiteralInit (literal.c:169)
==4963== by 0x8065315: wMainInterpret (main.c:483)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x4475b08 is 4 bytes after a block of size 4 alloc'd
==4963== at 0x4021BDE: calloc (vg_replace_malloc.c:397)
==4963== by 0x8049DA0: wMalloc (mem.c:153)
==4963== by 0x8052291: wLiteralAddNum (literal.c:57)
==4963== by 0x805249A: wLiteralInit (literal.c:169)
==4963== by 0x8065315: wMainInterpret (main.c:483)
==4963== by 0x80654C8: main (main.c:574)
==4963==
==4963== Invalid write of size 4
==4963== at 0x80522A4: wLiteralAddNum (literal.c:59)
==4963== by 0x80524AF: wLiteralInit (literal.c:170)
==4963== by 0x8065315: wMainInterpret (main.c:483)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x4475c30 is 4 bytes after a block of size 4 alloc'd
==4963== at 0x4021BDE: calloc (vg_replace_malloc.c:397)
==4963== by 0x8049DA0: wMalloc (mem.c:153)
==4963== by 0x8052291: wLiteralAddNum (literal.c:57)
==4963== by 0x80524AF: wLiteralInit (literal.c:170)
==4963== by 0x8065315: wMainInterpret (main.c:483)
==4963== by 0x80654C8: main (main.c:574)
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8062A14: list_desktops (wmctrlnew.c:838)
==4963== by 0x8064789: wBuiltin_wmctrl (wmctrlnew.c:1603)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8062A86: list_desktops (wmctrlnew.c:844)
==4963== by 0x8064789: wBuiltin_wmctrl (wmctrlnew.c:1603)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8062C19: list_desktops (wmctrlnew.c:881)
==4963== by 0x8064789: wBuiltin_wmctrl (wmctrlnew.c:1603)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x806303D: list_desktops (wmctrlnew.c:960)
==4963== by 0x8064789: wBuiltin_wmctrl (wmctrlnew.c:1603)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x80633AF: list_desktops (wmctrlnew.c:1024)
==4963== by 0x8064789: wBuiltin_wmctrl (wmctrlnew.c:1603)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063999: list_windows (wmctrlnew.c:1209)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063A29: list_windows (wmctrlnew.c:1215)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063AC6: list_windows (wmctrlnew.c:1222)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063B58: list_windows (wmctrlnew.c:1230)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063BF3: list_windows (wmctrlnew.c:1238)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063C79: list_windows (wmctrlnew.c:1255)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063CFF: list_windows (wmctrlnew.c:1262)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
==4963==
==4963== Invalid free() / delete / delete[]
==4963== at 0x402265C: free (vg_replace_malloc.c:323)
==4963== by 0x8049E27: wFree (mem.c:209)
==4963== by 0x8063D93: list_windows (wmctrlnew.c:1272)
==4963== by 0x8064814: wBuiltin_wmctrl (wmctrlnew.c:1619)
==4963== by 0x805D1AF: wCallRoutine (call.c:137)
==4963== by 0x8052BDB: wVmExecute (vm.c:279)
==4963== by 0x805D307: wCallRoutine (call.c:173)
==4963== by 0x8065496: wMainInterpret (main.c:560)
==4963== by 0x80654C8: main (main.c:574)
==4963== Address 0x806b30c is not stack'd, malloc'd or (recently) free'd
no visible windows on desk
==4963==
==4963== ERROR SUMMARY: 161 errors from 16 contexts (suppressed: 41 from 1)
==4963== malloc/free: in use at exit: 94,166 bytes in 1,289 blocks.
==4963== malloc/free: 4,973 allocs, 3,842 frees, 294,503 bytes allocated.
==4963== For counts of detected errors, rerun with: -v
==4963== searching for pointers to 1,289 not-freed blocks.
==4963== checked 270,336 bytes.
==4963==
==4963== LEAK SUMMARY:
==4963== definitely lost: 21,691 bytes in 527 blocks.
==4963== possibly lost: 744 bytes in 3 blocks.
==4963== still reachable: 71,731 bytes in 759 blocks.
==4963== suppressed: 0 bytes in 0 blocks.
==4963== Rerun with --leak-check=full to see details of leaked memory.