From: dbrownell Date: Thu, 17 Sep 2009 18:52:32 +0000 (+0000) Subject: Fix coredump seen in some code paths. X-Git-Tag: v0.3.0-rc0~228 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9655c5b093d459df001d7a11742d9a84183ce1f2;p=openocd Fix coredump seen in some code paths. git-svn-id: svn://svn.berlios.de/openocd/trunk@2723 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- diff --git a/src/helper/jim.c b/src/helper/jim.c index aa6382a9..d999c696 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -2828,6 +2828,9 @@ void FreeScriptInternalRep(Jim_Interp *interp, Jim_Obj *objPtr) int i; struct ScriptObj *script = (void*) objPtr->internalRep.ptr; + if (!script) + return; + script->inUse--; if (script->inUse != 0) return; for (i = 0; i < script->len; i++) {