sumom****@users*****
sumom****@users*****
2012年 7月 18日 (水) 18:42:39 JST
Index: julius4/libsent/src/voca/voca_malloc.c diff -u julius4/libsent/src/voca/voca_malloc.c:1.4 julius4/libsent/src/voca/voca_malloc.c:1.5 --- julius4/libsent/src/voca/voca_malloc.c:1.4 Fri Apr 29 14:09:20 2011 +++ julius4/libsent/src/voca/voca_malloc.c Wed Jul 18 18:42:38 2012 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Fri Feb 18 21:33:29 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -40,6 +40,15 @@ new->mroot = NULL; new->work = NULL; + winfo->wname = NULL; + winfo->woutput = NULL; + winfo->wlen = NULL; + winfo->wton = NULL; +#ifdef CLASS_NGRAM + winfo->cprob = NULL; +#endif + winfo->is_transparent = NULL; + return(new); } @@ -54,15 +63,14 @@ /* free each word info */ if (winfo->mroot != NULL) mybfree2(&(winfo->mroot)); /* free word info */ - free(winfo->wname); - free(winfo->woutput); - free(winfo->wseq); - free(winfo->wlen); - free(winfo->wton); + if (winfo->wname != NULL) free(winfo->wname); + if (winfo->woutput != NULL) free(winfo->woutput); + if (winfo->wlen != NULL) free(winfo->wlen); + if (winfo->wton != NULL) free(winfo->wton); #ifdef CLASS_NGRAM - free(winfo->cprob); + if (winfo->cprob != NULL) free(winfo->cprob); #endif - free(winfo->is_transparent); + if (winfo->is_transparent != NULL) free(winfo->is_transparent); /* free whole */ free(winfo); }