@@ -128,10 +128,14 @@ Tcl_Obj **objv; const char *arg; va_list argp; int retval; int i; + + if (interp == NULL) { + return(TCL_ERROR); + } objv = (void *) ckalloc(sizeof(*objv) * objc); objv[0] = Tcl_NewStringObj(cmd, -1); Tcl_IncrRefCount(objv[0]); @@ -165,10 +169,14 @@ APPFS_DEBUG("Enter: hostname = %s", hostname); interp = pthread_getspecific(interpKey); if (interp == NULL) { interp = appfs_create_TclInterp(globalThread.cachedir); + + if (interp == NULL) { + return; + } pthread_setspecific(interpKey, interp); } tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::getindex", hostname); @@ -187,10 +195,14 @@ int tcl_ret; interp = pthread_getspecific(interpKey); if (interp == NULL) { interp = appfs_create_TclInterp(globalThread.cachedir); + + if (interp == NULL) { + return(NULL); + } pthread_setspecific(interpKey, interp); } tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::download", hostname, sha1); @@ -210,10 +222,14 @@ int tcl_ret; interp = pthread_getspecific(interpKey); if (interp == NULL) { interp = appfs_create_TclInterp(globalThread.cachedir); + + if (interp == NULL) { + return; + } pthread_setspecific(interpKey, interp); } tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::getpkgmanifest", hostname, sha1);