Index: generic/xotclStack85.c =================================================================== diff -u -rf3cbadd6d76459cc00032877fa905bb618e9f780 -re2bce71b86e234dd095039949f8e7dbbb4a4620e --- generic/xotclStack85.c (.../xotclStack85.c) (revision f3cbadd6d76459cc00032877fa905bb618e9f780) +++ generic/xotclStack85.c (.../xotclStack85.c) (revision e2bce71b86e234dd095039949f8e7dbbb4a4620e) @@ -355,7 +355,7 @@ } #if 1 if (csc->cl) { - Namespace *nsPtr = ((Command *)(csc->cmdPtr))->nsPtr; + Namespace *nsPtr = csc->cmdPtr ? ((Command *)(csc->cmdPtr))->nsPtr : NULL; obj = &csc->cl->object; obj->activationCount --; @@ -373,18 +373,20 @@ CallStackDoDestroy(interp, obj); } - nsPtr->refCount--; - /*fprintf(stderr, "CallStackPop parent %s activationCount %d flags %.4x refCount %d\n", - nsPtr->fullName, nsPtr->activationCount, nsPtr->flags, nsPtr->refCount);*/ - - if ((nsPtr->refCount == 0) && (nsPtr->flags & NS_DEAD)) { - /* the namspace refcound has reached 0, we have to free - it. unfortunately, NamespaceFree() is not exported */ - fprintf(stderr, "HAVE TO FREE %p\n",nsPtr); - /*NamespaceFree(nsPtr);*/ - ckfree(nsPtr->fullName); - ckfree(nsPtr->name); - ckfree((char*)nsPtr); + if (nsPtr) { + nsPtr->refCount--; + /*fprintf(stderr, "CallStackPop parent %s activationCount %d flags %.4x refCount %d\n", + nsPtr->fullName, nsPtr->activationCount, nsPtr->flags, nsPtr->refCount);*/ + + if ((nsPtr->refCount == 0) && (nsPtr->flags & NS_DEAD)) { + /* the namspace refcound has reached 0, we have to free + it. unfortunately, NamespaceFree() is not exported */ + fprintf(stderr, "HAVE TO FREE %p\n",nsPtr); + /*NamespaceFree(nsPtr);*/ + ckfree(nsPtr->fullName); + ckfree(nsPtr->name); + ckfree((char*)nsPtr); + } } /*fprintf(stderr, "CallStackPop done\n");*/