Diff

Differences From Artifact [5ba05dc7d6]:

To Artifact [e3ba0e89d2]:


   126    126   
   127    127   static int appfs_Tcl_Eval(Tcl_Interp *interp, int objc, const char *cmd, ...) {
   128    128   	Tcl_Obj **objv;
   129    129   	const char *arg;
   130    130   	va_list argp;
   131    131   	int retval;
   132    132   	int i;
          133  +
          134  +	if (interp == NULL) {
          135  +		return(TCL_ERROR);
          136  +	}
   133    137   
   134    138   	objv = (void *) ckalloc(sizeof(*objv) * objc);
   135    139   	objv[0] = Tcl_NewStringObj(cmd, -1);
   136    140   	Tcl_IncrRefCount(objv[0]);
   137    141   
   138    142   	va_start(argp, cmd);
   139    143   	for (i = 1; i < objc; i++) {
................................................................................
   163    167   	int tcl_ret;
   164    168   
   165    169   	APPFS_DEBUG("Enter: hostname = %s", hostname);
   166    170   
   167    171   	interp = pthread_getspecific(interpKey);
   168    172   	if (interp == NULL) {
   169    173   		interp = appfs_create_TclInterp(globalThread.cachedir);
          174  +
          175  +		if (interp == NULL) {
          176  +			return;
          177  +		}
   170    178   
   171    179   		pthread_setspecific(interpKey, interp);
   172    180   	}
   173    181   
   174    182   	tcl_ret = appfs_Tcl_Eval(interp, 2, "::appfs::getindex", hostname);
   175    183   	if (tcl_ret != TCL_OK) {
   176    184   		APPFS_DEBUG("Call to ::appfs::getindex failed: %s", Tcl_GetStringResult(interp));
................................................................................
   185    193   	Tcl_Interp *interp;
   186    194   	char *retval;
   187    195   	int tcl_ret;
   188    196   
   189    197   	interp = pthread_getspecific(interpKey);
   190    198   	if (interp == NULL) {
   191    199   		interp = appfs_create_TclInterp(globalThread.cachedir);
          200  +
          201  +		if (interp == NULL) {
          202  +			return(NULL);
          203  +		}
   192    204   
   193    205   		pthread_setspecific(interpKey, interp);
   194    206   	}
   195    207   
   196    208   	tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::download", hostname, sha1);
   197    209   	if (tcl_ret != TCL_OK) {
   198    210   		APPFS_DEBUG("Call to ::appfs::download failed: %s", Tcl_GetStringResult(interp));
................................................................................
   208    220   static void appfs_update_manifest(const char *hostname, const char *sha1) {
   209    221   	Tcl_Interp *interp;
   210    222   	int tcl_ret;
   211    223   
   212    224   	interp = pthread_getspecific(interpKey);
   213    225   	if (interp == NULL) {
   214    226   		interp = appfs_create_TclInterp(globalThread.cachedir);
          227  +
          228  +		if (interp == NULL) {
          229  +			return;
          230  +		}
   215    231   
   216    232   		pthread_setspecific(interpKey, interp);
   217    233   	}
   218    234   
   219    235   	tcl_ret = appfs_Tcl_Eval(interp, 3, "::appfs::getpkgmanifest", hostname, sha1);
   220    236   	if (tcl_ret != TCL_OK) {
   221    237   		APPFS_DEBUG("Call to ::appfs::getpkgmanifest failed: %s", Tcl_GetStringResult(interp));