Index: kitsh/buildsrc/kitsh-0.0/cvfs_data.c ================================================================== --- kitsh/buildsrc/kitsh-0.0/cvfs_data.c +++ kitsh/buildsrc/kitsh-0.0/cvfs_data.c @@ -272,11 +272,11 @@ return(TCL_ERROR); } Tcl_IncrRefCount(ret_list); - children = malloc(sizeof(*children) * num_children); + children = (void *) Tcl_Alloc(sizeof(*children) * num_children); num_children = cmd_getChildren(file, children, num_children); for (idx = 0; idx < num_children; idx++) { finfo = cmd_getData(NULL, children[idx]); @@ -294,13 +294,13 @@ Tcl_ListObjAppendList(interp, ret_list, ret_curr_obj); Tcl_DecrRefCount(ret_curr_obj); } - free(children); + Tcl_Free((void *) children); Tcl_SetObjResult(interp, ret_list); Tcl_DecrRefCount(ret_list); return(TCL_OK); } Index: kitsh/buildsrc/kitsh-0.0/dir2c.tcl ================================================================== --- kitsh/buildsrc/kitsh-0.0/dir2c.tcl +++ kitsh/buildsrc/kitsh-0.0/dir2c.tcl @@ -235,10 +235,11 @@ # include # endif # ifdef HAVE_STDLIB_H # include # endif +# include # ifndef LOADED_CVFS_COMMON # define LOADED_CVFS_COMMON 1 typedef enum { @@ -510,14 +511,14 @@ puts "static void ${code_tag}_decryptFile(const char *path, struct cvfs_data *finfo) {" puts "\tstatic struct cvfs_key key = { [string map [list "\n" " "] [encrypt_key_export $obsfucation_key "c"]] };" puts "\tunsigned char *new_data, *old_data;" puts "\tint decrypt_ret, free_old_data;" puts "" - puts "\tnew_data = malloc(finfo->size);" + puts "\tnew_data = (void *) Tcl_Alloc(finfo->size);" puts "\tdecrypt_ret = cvfs_decrypt(new_data, finfo->data, finfo->size, &key);" puts "\tif (decrypt_ret != 0) {" - puts "\t\tfree(new_data);" + puts "\t\tTcl_Free((void *) new_data);" puts "" puts "\t\treturn;" puts "\t}" puts "" puts "\tfree_old_data = finfo->free;" @@ -526,11 +527,11 @@ puts "\tfinfo->data = new_data;" puts "\tfinfo->free = 1;" puts "\tfinfo->type = CVFS_FILETYPE_FILE;" puts "" puts "\tif (free_old_data) {" - puts "\t\tfree(old_data);" + puts "\t\tTcl_Free((void *) old_data);" puts "\t}" puts "\treturn;" puts "}" puts "" }