Check-in [651fd8051a]
Overview
Comment:Updated to decrement reference count for objects as we are done with them
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:651fd8051a57864eacbe5df537764f873df65f67
User & Date: rkeene on 2014-11-14 06:13:49
Other Links: manifest | tags
Context
2014-11-14
17:25
Made an optional exit path and removed decrementing of reference counters check-in: ec17efd4bb user: rkeene tags: trunk
06:13
Updated to decrement reference count for objects as we are done with them check-in: 651fd8051a user: rkeene tags: trunk
05:20
Added back completely needed operation check-in: 84483d5933 user: rkeene tags: trunk
Changes

Modified appfsd.c from [cb5c5230cc] to [4a8cebc0f0].

   755    755   		return(-EIO);
   756    756   	}
   757    757   
   758    758   	pathinfo->packaged = 0;
   759    759   	pathinfo->inode = appfs_get_path_inode(path);
   760    760   
   761    761   	attr_value_str = Tcl_GetString(attr_value);
          762  +
          763  +	Tcl_DecrRefCount(attr_value);
          764  +
   762    765   	switch (attr_value_str[0]) {
   763    766   		case 'd': /* directory */
   764    767   			pathinfo->type = APPFS_PATHTYPE_DIRECTORY;
   765    768   			pathinfo->typeinfo.dir.childcount = 0;
   766    769   
   767    770   			Tcl_DictObjGet(interp, attrs_dict, attr_key_childcount, &attr_value);
   768    771   			if (attr_value != NULL) {
   769    772   				tcl_ret = Tcl_GetWideIntFromObj(NULL, attr_value, &attr_value_wide);
   770    773   				if (tcl_ret == TCL_OK) {
   771    774   					pathinfo->typeinfo.dir.childcount = attr_value_wide;
   772    775   				}
          776  +
          777  +				Tcl_DecrRefCount(attr_value);
   773    778   			}
   774    779   
   775    780   			break;
   776    781   		case 'f': /* file */
   777    782   			pathinfo->type = APPFS_PATHTYPE_FILE;
   778    783   			pathinfo->typeinfo.file.size = 0;
   779    784   			pathinfo->typeinfo.file.executable = 0;
................................................................................
   780    785   
   781    786   			Tcl_DictObjGet(interp, attrs_dict, attr_key_size, &attr_value);
   782    787   			if (attr_value != NULL) {
   783    788   				tcl_ret = Tcl_GetWideIntFromObj(NULL, attr_value, &attr_value_wide);
   784    789   				if (tcl_ret == TCL_OK) {
   785    790   					pathinfo->typeinfo.file.size = attr_value_wide;
   786    791   				}
          792  +
          793  +				Tcl_DecrRefCount(attr_value);
   787    794   			}
   788    795   
   789    796   			Tcl_DictObjGet(interp, attrs_dict, attr_key_perms, &attr_value);
   790    797   			if (attr_value != NULL) {
   791    798   				attr_value_str = Tcl_GetString(attr_value);
   792    799   				if (attr_value_str[0] == 'x') {
   793    800   					pathinfo->typeinfo.file.executable = 1;
   794    801   				}
          802  +
          803  +				Tcl_DecrRefCount(attr_value);
   795    804   			}
   796    805   			break;
   797    806   		case 's': /* symlink */
   798    807   			pathinfo->type = APPFS_PATHTYPE_SYMLINK;
   799    808   			pathinfo->typeinfo.symlink.size = 0;
   800    809   			pathinfo->typeinfo.symlink.source[0] = '\0';
   801    810   
................................................................................
   805    814   
   806    815   				if ((attr_value_int + 1) <= sizeof(pathinfo->typeinfo.symlink.source)) {
   807    816   					pathinfo->typeinfo.symlink.size = attr_value_int;
   808    817   					pathinfo->typeinfo.symlink.source[attr_value_int] = '\0';
   809    818   
   810    819   					memcpy(pathinfo->typeinfo.symlink.source, attr_value_str, attr_value_int);
   811    820   				}
          821  +
          822  +				Tcl_DecrRefCount(attr_value);
   812    823   			}
   813    824   			break;
   814    825   		case 'F': /* pipe/fifo */
   815    826   			pathinfo->type = APPFS_PATHTYPE_FIFO;
   816    827   			break;
   817    828   		case 'S': /* UNIX domain socket */
   818    829   			pathinfo->type = APPFS_PATHTYPE_SOCKET;
   819    830   			break;
   820    831   		default:
          832  +			Tcl_DecrRefCount(attrs_dict);
          833  +
   821    834   			Tcl_Release(interp);
   822    835   
   823    836   			return(-EIO);
   824    837   	}
   825    838   
   826    839   	Tcl_DictObjGet(interp, attrs_dict, attr_key_packaged, &attr_value);
   827    840   	if (attr_value != NULL) {
   828    841   		pathinfo->packaged = 1;
          842  +
          843  +		Tcl_DecrRefCount(attr_value);
   829    844   	}
   830    845   
   831    846   	Tcl_DictObjGet(interp, attrs_dict, attr_key_time, &attr_value);
   832    847   	if (attr_value != NULL) {
   833    848   		tcl_ret = Tcl_GetWideIntFromObj(NULL, attr_value, &attr_value_wide);
   834    849   		if (tcl_ret == TCL_OK) {
   835    850   			pathinfo->time = attr_value_wide;
   836    851   		}
          852  +
          853  +		Tcl_DecrRefCount(attr_value);
   837    854   	} else {
   838    855   		pathinfo->time = 0;
   839    856   	}
   840    857   
   841    858   	Tcl_Release(interp);
   842    859   
   843    860   	appfs_get_path_info_cache_add(path, fsuid, pathinfo);
................................................................................
  1046   1063   
  1047   1064   		return(0);
  1048   1065   	}
  1049   1066   
  1050   1067   	for (idx = 0; idx < children_count; idx++) {
  1051   1068   		filler(buf, Tcl_GetString(children[idx]), NULL, 0);
  1052   1069   	}
         1070  +
         1071  +	Tcl_DecrRefCount(children);
  1053   1072   
  1054   1073   	Tcl_Release(interp);
  1055   1074   
  1056   1075   	return(0);
  1057   1076   }
  1058   1077   
  1059   1078   static int appfs_fuse_open(const char *path, struct fuse_file_info *fi) {