1 diff -uNr Xsi.orig/Wnn/etc/bdic.c Xsi/Wnn/etc/bdic.c
2 --- Xsi.orig/Wnn/etc/bdic.c Wed Oct 28 13:36:16 1998
3 +++ Xsi/Wnn/etc/bdic.c Tue Nov 10 05:17:21 1998
5 hjt.hindo_area = (int)((serial + MAX_HINDO_DATA_AREA - 1) / MAX_HINDO_DATA_AREA);
6 if(hjt.hindo_area != 0) {
7 if((hjt.curserial = (unsigned char *)
8 - malloc(hjt.hindo_area * sizeof(unsigned char))) == NULL)
9 + malloc0(hjt.hindo_area * sizeof(unsigned char))) == NULL)
11 for(i = 0; i < hjt.hindo_area; i++) (hjt.curserial)[i] = 0;
15 if(hjt1->hindo_area != 0) {
16 if((hjt1->curserial = (unsigned char *)
17 - malloc(hjt1->hindo_area * sizeof(unsigned char))) == NULL)
18 + malloc0(hjt1->hindo_area * sizeof(unsigned char))) == NULL)
20 for(i = 0; i < hjt1->hindo_area; i++)
21 (hjt1->curserial)[i] = vgetc(ifpter, args);
22 diff -uNr Xsi.orig/Wnn/etc/fi_bdic.c Xsi/Wnn/etc/fi_bdic.c
23 --- Xsi.orig/Wnn/etc/fi_bdic.c Wed Oct 28 13:36:17 1998
24 +++ Xsi/Wnn/etc/fi_bdic.c Tue Nov 10 05:17:02 1998
29 +extern char *malloc0();
34 /* ÀܳÄêµÁ£×£î£î¼½ñ f_uniq ÇÛÎó¤ÎÆɤ߹þ¤ß */
36 if((jt1->jisho_uniq = (struct wnn_file_uniq *)
37 - malloc(jt1->maxjisho * sizeof(struct wnn_file_uniq))) == NULL)
38 + malloc0(jt1->maxjisho * sizeof(struct wnn_file_uniq))) == NULL)
40 for(i = 0; i < jt1->maxjisho; i++) {
41 if(input_file_uniq(&((jt1->jisho_uniq)[i]), ifpter, args) == -1)
42 diff -uNr Xsi.orig/Wnn/etc/gethinsi.c Xsi/Wnn/etc/gethinsi.c
43 --- Xsi.orig/Wnn/etc/gethinsi.c Wed Oct 28 13:36:17 1998
44 +++ Xsi/Wnn/etc/gethinsi.c Tue Nov 10 05:12:15 1998
46 extern char *hinsi_file_name;
47 #endif /* !DSERVER && JSERVER */
49 +extern char *malloc0();
57 static int wnn_find_load_hinsi_by_name();
59 - if((hdata = (struct HDT *)malloc(sizeof(struct HDT))) == NULL) {
60 + if((hdata = (struct HDT *)malloc0(sizeof(struct HDT))) == NULL) {
63 hp = heap = hdata->heap;
73 diff -uNr Xsi.orig/Wnn/etc/msg.c Xsi/Wnn/etc/msg.c
74 --- Xsi.orig/Wnn/etc/msg.c Wed Oct 28 13:36:18 1998
75 +++ Xsi/Wnn/etc/msg.c Tue Nov 10 05:13:39 1998
78 extern char *getenv();
80 +extern char *malloc0();
84 bsearch(ky, bs, nel, width, compar)
90 - if (!(cd = (struct msg_cat *)malloc(sizeof(struct msg_cat))))
91 + if (!(cd = (struct msg_cat *)malloc0(sizeof(struct msg_cat))))
94 strcpy(cd->name, name);
97 cd->msg_cnt = msg_cnt;
98 if (!(bd = cd->msg_bd = (struct msg_bd *)
99 - malloc((sizeof(struct msg_bd)) * msg_cnt + msg_byte + 1))) {
100 + malloc0((sizeof(struct msg_bd)) * msg_cnt + msg_byte + 1))) {
106 msg = (char *) bd + (sizeof(struct msg_bd)) * msg_cnt;
109 msg_close(cd->nextp);
119 diff -uNr Xsi.orig/Wnn/jlib/jl.c Xsi/Wnn/jlib/jl.c
120 --- Xsi.orig/Wnn/jlib/jl.c Wed Oct 28 13:36:30 1998
121 +++ Xsi/Wnn/jlib/jl.c Tue Nov 10 05:07:39 1998
123 #include "wnn_string.h"
124 extern struct msg_cat *wnn_msg_cat;
126 +extern char *malloc0();
127 +extern void free0();
128 +extern char *realloc0();
130 #define MAXENVS WNN_MAX_ENV_OF_A_CLIENT
135 register struct wnn_file_name_id *f, *f1;
136 - if((f = (struct wnn_file_name_id *)malloc(sizeof(struct wnn_file_name_id) +
137 + if((f = (struct wnn_file_name_id *)malloc0(sizeof(struct wnn_file_name_id) +
138 strlen(name) + 1)) == NULL){
139 env_wnn_errorno_set=WNN_ALLOC_FAIL;
142 for(prev = &jl_env_p->file; (f = *prev); prev = &f->next){
147 UnlockMutex(&envs_lock);
150 @@ -774,10 +777,10 @@
154 - if(rb.size == 0) rb.buf = (char *)malloc((unsigned)(rb.size = 1024));
155 + if(rb.size == 0) rb.buf = (char *)malloc0((unsigned)(rb.size = 1024));
157 #define ALLOC_SET(pter, type, size, size_var) \
158 - ((pter) = ((type *)malloc((unsigned)(sizeof(type) * ((size_var) = (size))))))
159 + ((pter) = ((type *)malloc0((unsigned)(sizeof(type) * ((size_var) = (size))))))
161 if(!ALLOC_SET(buf, struct wnn_buf_mt, 1, dmy)){
162 wnn_errorno=WNN_ALLOC_FAIL;return NULL;
167 - if((c =(char **)malloc((unsigned)(len * sizeof(WNN_BUN) + sizeof(char *)))) == NULL){
168 + if((c =(char **)malloc0((unsigned)(len * sizeof(WNN_BUN) + sizeof(char *)))) == NULL){
169 buf_wnn_errorno_set=WNN_ALLOC_FAIL;
172 @@ -918,15 +921,15 @@
176 - if(buf->bun) free((char *)buf->bun);
177 - if(buf->zenkouho) free((char *)buf->zenkouho);
178 - if(buf->zenkouho_dai) free((char *)buf->zenkouho_dai);
179 - if(buf->down_bnst) free((char *)buf->down_bnst);
180 + if(buf->bun) free0((char *)buf->bun);
181 + if(buf->zenkouho) free0((char *)buf->zenkouho);
182 + if(buf->zenkouho_dai) free0((char *)buf->zenkouho_dai);
183 + if(buf->down_bnst) free0((char *)buf->down_bnst);
184 for(c = buf->heap; c; c = next) {
190 + free0((char *)buf);
191 UnlockMutex(&(tmpbuf.buf_lock));
194 @@ -1027,11 +1030,11 @@
198 - hno = (int *)malloc(hsize * sizeof(int));
199 + hno = (int *)malloc0(hsize * sizeof(int));
200 for(i = 0; i < hsize; i++) {
201 _Sstrcpy(tmp, hname[i]);
202 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
204 + free0((char *)hno);
205 UnlockMutex(&BUF_LOCK(buf));
208 @@ -1040,7 +1043,7 @@
210 x = ren_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep,
212 - if(nhinsi) free((char *)hno);
213 + if(nhinsi) free0((char *)hno);
214 UnlockMutex(&BUF_LOCK(buf));
216 } /* End of jl_ren_conv_with_hinsi_name */
217 @@ -1422,11 +1425,11 @@
221 - hno = (int *)malloc(hsize * sizeof(int));
222 + hno = (int *)malloc0(hsize * sizeof(int));
223 for(i = 0; i < hsize; i++) {
224 _Sstrcpy(tmp, hname[i]);
225 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
227 + free0((char *)hno);
228 UnlockMutex(&BUF_LOCK(buf));
231 @@ -1435,11 +1438,11 @@
233 if(tan_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep,
234 ich_shop, 0, nhinsi, hno) == -1) {
235 - if(nhinsi) free((char *)hno);
236 + if(nhinsi) free0((char *)hno);
237 UnlockMutex(&BUF_LOCK(buf));
240 - if(nhinsi) free((char *)hno);
241 + if(nhinsi) free0((char *)hno);
243 UnlockMutex(&BUF_LOCK(buf));
245 @@ -1767,11 +1770,11 @@
249 - hno = (int *)malloc(hsize * sizeof(int));
250 + hno = (int *)malloc0(hsize * sizeof(int));
251 for(i = 0; i < hsize; i++) {
252 _Sstrcpy(tmp, hname[i]);
253 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
255 + free0((char *)hno);
256 UnlockMutex(&BUF_LOCK(buf));
259 @@ -1780,11 +1783,11 @@
261 if(nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop,
262 nhinsi, hno, 0) == -1) {
263 - if(nhinsi) free((char *)hno);
264 + if(nhinsi) free0((char *)hno);
265 UnlockMutex(&BUF_LOCK(buf));
268 - if(nhinsi) free((char *)hno);
269 + if(nhinsi) free0((char *)hno);
271 UnlockMutex(&BUF_LOCK(buf));
273 @@ -2206,18 +2209,18 @@
277 - hno = (int *)malloc(hsize * sizeof(int));
278 + hno = (int *)malloc0(hsize * sizeof(int));
279 for(i = 0; i < hsize; i++) {
280 _Sstrcpy(tmp, hname[i]);
281 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
283 + free0((char *)hno);
284 UnlockMutex(&BUF_LOCK(buf));
289 x = zen_conv_sho1(buf, bun_no, use_maep, uniq_level, 0, nhinsi, hno);
290 - if(nhinsi) free((char *)hno);
291 + if(nhinsi) free0((char *)hno);
292 UnlockMutex(&BUF_LOCK(buf));
295 @@ -2431,18 +2434,18 @@
299 - hno = (int *)malloc(hsize * sizeof(int));
300 + hno = (int *)malloc0(hsize * sizeof(int));
301 for(i = 0; i < hsize; i++) {
302 _Sstrcpy(tmp, hname[i]);
303 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
305 + free0((char *)hno);
306 UnlockMutex(&BUF_LOCK(buf));
311 x = zen_conv_dai1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, nhinsi, hno);
312 - if(nhinsi) free((char *)hno);
313 + if(nhinsi) free0((char *)hno);
314 UnlockMutex(&BUF_LOCK(buf));
317 @@ -3175,46 +3178,46 @@
318 /* Á°³ÎÄêʸÀá¾ðÊóʬ¤ò³ÎÄê¸õÊä¿ô¤Ë²Ã¤¨¤ë */
319 nkouho = bun_no2 - bun_no + WNN_PREV_BUN_SUU;
321 - if ( (dic = (int *)malloc(nkouho * sizeof(int))) == NULL )
322 + if ( (dic = (int *)malloc0(nkouho * sizeof(int))) == NULL )
325 - if ( (entry = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
327 + if ( (entry = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
331 - if ( (ima = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
334 + if ( (ima = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
339 - if ( (hindo = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
343 + if ( (hindo = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
349 - if ( (kmoji = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
354 + if ( (kmoji = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
361 - if ( (kouho = (w_char **)malloc(nkouho * sizeof(w_char *))) == NULL ) {
367 + if ( (kouho = (w_char **)malloc0(nkouho * sizeof(w_char *))) == NULL ) {
375 - if ( (tmp = (w_char *)malloc(nkouho * sizeof(w_char) * LENGTHKANJI)) == NULL ) {
382 + if ( (tmp = (w_char *)malloc0(nkouho * sizeof(w_char) * LENGTHKANJI)) == NULL ) {
391 for(k = 0; k < nkouho; k++) {
392 @@ -3280,23 +3283,23 @@
394 buf_wnn_errorno_copy((WNN_BUF_MT *)buf)
395 if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) {
428 } /* End of optimize_in_server */
430 @@ -4482,7 +4485,7 @@
431 if(--wb->ref_cnt <= 0){
433 if((wb1 == wb) && (wb->hinsi_list != NULL)) {
434 - free((char *)(wb->hinsi_list));
435 + free0((char *)(wb->hinsi_list));
436 wb->hinsi_list = NULL;
438 wb->free_next = buf->orig.free_heap;
439 @@ -4593,7 +4596,7 @@
440 wb->num_hinsi = nhinsi;
442 int hsize = abs(nhinsi) * sizeof(int);
443 - if((wb->hinsi_list = (int *)malloc(hsize)) == NULL) return(NULL);
444 + if((wb->hinsi_list = (int *)malloc0(hsize)) == NULL) return(NULL);
445 bcopy(hlist, wb->hinsi_list, hsize);
447 wb->hinsi_list = NULL;
448 @@ -4660,7 +4663,7 @@
450 newsize = buf->orig.bun_suu + cnt - (bun_no2 - bun_no);
452 -#define Realloc(a, b) realloc((char *)(a), (unsigned)(b))
453 +#define Realloc(a, b) realloc0((char *)(a), (unsigned)(b))
455 if(newsize > buf->orig.msize_bun){
456 buf->orig.bun = (WNN_BUN **)Realloc(buf->orig.bun, newsize * sizeof(WNN_BUN *));
457 @@ -5012,7 +5015,7 @@
466 @@ -5387,10 +5390,10 @@
477 } /* End of jl_free */
479 @@ -6213,22 +6216,22 @@
480 int ii, *hlist, nhinsi = num - 1;
483 - if(!(hlist = (int *)malloc(nhinsi * sizeof(int))))
484 + if(!(hlist = (int *)malloc0(nhinsi * sizeof(int))))
486 for(ii = 0; ii < nhinsi; ii++) {
487 _Sstrcpy(whname, s[ii]);
489 jl_hinsi_number_e_body(env, whname)) == -1) {
490 - free((char *)hlist);
491 + free0((char *)hlist);
495 if(strcmp(code, "unuse_hinsi") == 0) nhinsi *= -1;
496 if(js_set_henkan_hinsi(env, 1, nhinsi, hlist) < 0) {
497 - free((char *)hlist);
498 + free0((char *)hlist);
501 - free((char *)hlist);
502 + free0((char *)hlist);
506 @@ -6974,11 +6977,11 @@
510 - hno = (int *)malloc(hsize * sizeof(int));
511 + hno = (int *)malloc0(hsize * sizeof(int));
512 for(i = 0; i < hsize; i++) {
513 _Sstrcpy(tmp, hname[i]);
514 if((hno[i] = jl_hinsi_number_e_body(env, tmp)) == -1) {
516 + free0((char *)hno);
520 @@ -6987,10 +6990,10 @@
521 if((x = js_set_henkan_hinsi(env, mode, nhinsi, hno)) == -1) {
522 env_wnn_errorno_copy(env);
523 if_dead_disconnect(env);
524 - if(nhinsi) free((char *)hno);
525 + if(nhinsi) free0((char *)hno);
528 - if(nhinsi) free((char *)hno);
529 + if(nhinsi) free0((char *)hno);
533 @@ -8164,7 +8167,7 @@
534 if (!buf || !buf->bun || !(data = buf->bun[bun_no])) return(-1);
535 if (js_dic_info(buf->env, data->dic_no, &dic) < 0)
537 - if (!(yomi = (w_char *)malloc(sizeof(w_char) * (data->yomilen + 1))))
538 + if (!(yomi = (w_char *)malloc0(sizeof(w_char) * (data->yomilen + 1))))
540 wnn_Strncpy(yomi, data->yomi, data->yomilen);
541 yomi[data->yomilen] = (w_char)0;
542 @@ -8191,12 +8194,12 @@
543 InfoShoRec *info, *prev;
545 if (max <= 0) return(NULL);
546 - if (!(info = (InfoShoRec *)malloc(sizeof(InfoShoRec) * max))) return(NULL);
547 + if (!(info = (InfoShoRec *)malloc0(sizeof(InfoShoRec) * max))) return(NULL);
548 bzero((char *)info, sizeof(InfoShoRec) * max);
550 for (i = 0; i < max; i++) {
551 if (Sho_Info(buf, i, &info[i]) < 0) {
552 - free((char *)info);
553 + free0((char *)info);
557 @@ -8214,7 +8217,7 @@
560 if (!p) return(NULL);
561 - if (!(info = (InfoTotalRec *)malloc(sizeof(InfoTotalRec)))) return(NULL);
562 + if (!(info = (InfoTotalRec *)malloc0(sizeof(InfoTotalRec)))) return(NULL);
563 bzero((char *)info, sizeof(InfoTotalRec));
565 for (; p; p = p->next) {
566 @@ -8243,7 +8246,7 @@
569 if (cnt <= 0) return(NULL);
570 - if (!(info = (InfoDaiRec *)malloc(sizeof(InfoDaiRec) * cnt))) return(NULL);
571 + if (!(info = (InfoDaiRec *)malloc0(sizeof(InfoDaiRec) * cnt))) return(NULL);
572 bzero((char *)info, sizeof(InfoDaiRec) * cnt);
575 @@ -8585,18 +8588,18 @@
579 - hno = (int *)malloc(hsize * sizeof(int));
580 + hno = (int *)malloc0(hsize * sizeof(int));
581 for(i = 0; i < hsize; i++) {
582 _Sstrcpy(tmp, hname[i]);
583 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
585 + free0((char *)hno);
586 UnlockMutex(&BUF_LOCK(buf));
591 x = zen_conv_dai_ikeiji1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, nhinsi, hno);
592 - if(nhinsi) free((char *)hno);
593 + if(nhinsi) free0((char *)hno);
594 UnlockMutex(&BUF_LOCK(buf));
597 diff -uNr Xsi.orig/Wnn/jlib/js.c Xsi/Wnn/jlib/js.c
598 --- Xsi.orig/Wnn/jlib/js.c Wed Oct 28 13:36:31 1998
599 +++ Xsi/Wnn/jlib/js.c Tue Nov 10 05:04:13 1998
604 -extern char *malloc();
605 +extern char *malloc0();
606 +extern void free0();
607 +extern char *realloc0();
612 #include "../etc/pwd.c"
618 typedef struct _host_address {
622 if (!(sp = getservbyname(name,"tcp"))) return(-1);
624 - if (!(p = (my_serv_struct *)malloc(sizeof(my_serv_struct) + len + 1)))
625 + if (!(p = (my_serv_struct *)malloc0(sizeof(my_serv_struct) + len + 1)))
627 p->name = ((char *)p) + sizeof(my_serv_struct);
628 strcpy(p->name, name);
632 sbp=0; /* init sndBufPointer */
633 - if(!(new_js=(char *)malloc(sizeof(WNN_JSERVER_ID_INT)))){
634 + if(!(new_js=(char *)malloc0(sizeof(WNN_JSERVER_ID_INT)))){
635 js_wnn_errorno_set=WNN_ALLOC_FAIL;
639 server->js_dead_env_flg= 0;
640 if((current_sd= cd_open_in_by_addr(addr, addrlen, port, tmout))==-1){
641 js_wnn_errorno_set = WNN_NO_JSERVER;
642 - free((char*)server);
643 + free0((char*)server);
649 UnlockMutex(&msg_lock);
651 - if(!(new_js=(char *)malloc(sizeof(WNN_JSERVER_ID_INT)))){
652 + if(!(new_js=(char *)malloc0(sizeof(WNN_JSERVER_ID_INT)))){
653 wnn_errorno=WNN_ALLOC_FAIL;
658 if((current_sd= cd_open(lang))==-1){
659 UnlockMutex(&open_lock);
660 - wnn_errorno=WNN_SOCK_OPEN_FAIL;free((char*)current_js);current_js=NULL;
661 + wnn_errorno=WNN_SOCK_OPEN_FAIL;free0((char*)current_js);current_js=NULL;
666 host[WNN_HOSTLEN-1] = '\0'; /* truncate by WNN_HOSTLEN */
667 if((current_sd= cd_open_in(servername, lang, tmout))==-1){
668 UnlockMutex(&open_lock);
669 - wnn_errorno=WNN_SOCK_OPEN_FAIL;free((char*)current_js);current_js=NULL;
670 + wnn_errorno=WNN_SOCK_OPEN_FAIL;free0((char*)current_js);current_js=NULL;
674 @@ -1036,7 +1038,7 @@
676 if(server==0) return(-1);
677 tmp_js_id = *(WNN_JSERVER_ID_INT *)server;
678 - free((char *)server);
679 + free0((char *)server);
680 current_js = &tmp_js_id;
681 server = (WNN_JSERVER_ID *)current_js;
682 set_current_js(server);
683 @@ -1074,7 +1076,7 @@
686 set_current_js(server);
687 - if(!(env=(struct wnn_env_int *)malloc(sizeof(struct wnn_env_int)))){
688 + if(!(env=(struct wnn_env_int *)malloc0(sizeof(struct wnn_env_int)))){
689 js_wnn_errorno_set=WNN_ALLOC_FAIL;
692 @@ -1082,14 +1084,14 @@
693 handler_of_jserver_dead(server);
694 if(js_wnn_errorno_eql) {
695 UnlockMutex(&(server_js_lock));
700 snd_head(JS_CONNECT, server);
701 putscom(env_name, server);
703 e_id=get4com(server);
704 - if(e_id==-1){ js_wnn_errorno_set= get4com(server); free(env); return NULL; }
705 + if(e_id==-1){ js_wnn_errorno_set= get4com(server); free0(env); return NULL; }
706 UnlockMutex(&(server_js_lock));
707 env->orig.env_id = e_id;
708 env->orig.js_id = (WNN_JSERVER_ID *)server;
709 @@ -1188,7 +1190,7 @@
710 if(env==0) return(-1);
711 /* ËÜÍè¤Ï¡¢free ¤·¤Ê¤¤ã¤¢¤«¤ó¤Î¤À¤±¤É¡¢¥ê¥½¡¼¥¹´ÉÍý¤¬½ÐÍè¤Ê¤¤¤·¡¢
712 ¤Þ¤¢¡¢8¥Ð¥¤¥È¤À¤«¤é¡¢¥´¥ß¤¬»Ä¤ë¤±¤É¤¤¤¤¤À¤í¤¦¡£
714 + free0((char *)env);
716 set_current_js(env->js_id);
717 LockMutex(&(env_js_lock));
718 @@ -1581,7 +1583,7 @@
719 UnlockMutex(&(env_js_lock)); return -1;
721 *nhinsi = get4com(env->js_id);
722 - if(((*hlist) = (int *)malloc(abs(*nhinsi) * sizeof(int))) == NULL) {
723 + if(((*hlist) = (int *)malloc0(abs(*nhinsi) * sizeof(int))) == NULL) {
725 for(i = 0; i < abs(*nhinsi); i++) dummy = get4com(env->js_id);
726 env_wnn_errorno_set = WNN_ALLOC_FAIL;
727 @@ -2839,7 +2841,7 @@
728 *curfzk = get4com(server);
730 /* ¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤÎÎΰè¤ò³ÎÊݤ¹¤ë */
731 - if(((*ret) = (WNN_FZK_INFO *)malloc((count + 1) *
732 + if(((*ret) = (WNN_FZK_INFO *)malloc0((count + 1) *
733 sizeof(WNN_FZK_INFO))) == NULL) {
735 for(i = 0; i < count; i++){
736 @@ -3724,13 +3726,13 @@
737 if(ret->size < ret->num + fi_num) {
738 /* ¿·¤¿¤Ë£Æ£É´Ø·¸¥Ç¡¼¥¿¹½Â¤ÂÎÇÛÎó¤ò³ÎÊݤ¹¤ë */
739 fi_data = (struct fi_rel_data *)
740 - malloc((ret->num + fi_num) * sizeof(struct fi_rel_data));
741 + malloc0((ret->num + fi_num) * sizeof(struct fi_rel_data));
743 /* ´û¤Ë»ÈÍѤ·¤Æ¤¤¤¿£Æ£É´Ø·¸¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë */
746 bcopy(ret->fi_buf, fi_data, ret->num * sizeof(struct fi_rel_data));
747 - free((char *)ret->fi_buf);
748 + free0((char *)ret->fi_buf);
751 ret->fi_buf = fi_data;
752 @@ -3962,8 +3964,8 @@
754 if(ret->size < size){
756 - free((char *)ret->buf);
757 - ret->buf = malloc(size);
758 + free0((char *)ret->buf);
759 + ret->buf = malloc0(size);
763 @@ -4263,7 +4265,7 @@
764 funiq.createhost[i]=get1com(env->js_id);
766 njisho = get1com(env->js_id);
767 - if((primary = (int *)malloc(njisho * sizeof(int))) == NULL) {
768 + if((primary = (int *)malloc0(njisho * sizeof(int))) == NULL) {
769 env_wnn_errorno_set = WNN_MALLOC_ERR;
770 UnlockMutex(&(env_js_lock));
772 @@ -4271,12 +4273,12 @@
773 for(i = 0; i < njisho; i++)
774 primary[i] = get4com(env->js_id);
775 if(create_fi_hindo_file(&funiq,fn,com,hpasswd,njisho,primary,NULL) == -1){
778 env_wnn_errorno_set = WNN_FILE_CREATE_ERROR;
779 UnlockMutex(&(env_js_lock));
784 UnlockMutex(&(env_js_lock));
786 } /* End of js_fi_hindo_file_create_client */
787 @@ -4563,7 +4565,7 @@
790 if (num == 0) return(0);
791 - if (!(l = (char **)(s = malloc((sizeof(char *) * num) + total)))) {
792 + if (!(l = (char **)(s = malloc0((sizeof(char *) * num) + total)))) {
793 js_wnn_errorno_set = WNN_MALLOC_ERR;
796 @@ -4897,7 +4899,7 @@
797 UnlockMutex(&(server_js_lock));
798 return((char **)NULL);
800 - if (!(save = p = malloc((sizeof(host_address) * total_num) + bytes))) {
801 + if (!(save = p = malloc0((sizeof(host_address) * total_num) + bytes))) {
802 for (i = 0; i < bytes; i++) get1com(server);
803 js_wnn_errorno_set = WNN_MALLOC_ERR;
804 return((char **)NULL);
805 @@ -4931,8 +4933,8 @@
807 total += get_host_name_len(host_p);
809 - if (!(p = malloc((sizeof(char *) * total_num) + total + total_num))) {
810 - free((char *)save);
811 + if (!(p = malloc0((sizeof(char *) * total_num) + total + total_num))) {
812 + free0((char *)save);
813 js_wnn_errorno_set = WNN_MALLOC_ERR;
814 UnlockMutex(&(server_js_lock));
815 return((char **)NULL);
816 @@ -4947,7 +4949,7 @@
818 p += get_host_name(host_p, p) + 1;
820 - free((char *)save);
821 + free0((char *)save);
822 *ret_num = total_num;
823 UnlockMutex(&(server_js_lock));
825 @@ -5449,5 +5451,6 @@
828 /* end of js_ikeiji_with_data */
832 diff -uNr Xsi.orig/Wnn/jlib/malloc.c Xsi/Wnn/jlib/malloc.c
833 --- Xsi.orig/Wnn/jlib/malloc.c Thu Jan 1 09:00:00 1970
834 +++ Xsi/Wnn/jlib/malloc.c Tue Nov 10 04:58:00 1998
840 + * Copyright Kyoto University Research Institute for Mathematical Sciences
841 + * 1987, 1988, 1989, 1990, 1991
842 + * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991
843 + * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991
845 + * Permission to use, copy, modify, distribute, and sell this software
846 + * and its documentation for any purpose is hereby granted without fee,
847 + * provided that all of the following conditions are satisfied:
849 + * 1) The above copyright notices appear in all copies
850 + * 2) Both those copyright notices and this permission notice appear
851 + * in supporting documentation
852 + * 3) The name of "Wnn" isn't changed unless substantial modifications
854 + * 3') Following words followed by the above copyright notices appear
855 + * in all supporting documentation of software based on "Wnn":
857 + * "This software is based on the original version of Wnn developed by
858 + * Kyoto University Research Institute for Mathematical Sciences (KURIMS),
859 + * OMRON Corporation and ASTEC Inc."
861 + * 4) The names KURIMS, OMRON and ASTEC not be used in advertising or
862 + * publicity pertaining to distribution of the software without
863 + * specific, written prior permission
865 + * KURIMS, OMRON and ASTEC make no representations about the suitability
866 + * of this software for any purpose. It is provided "as is" without
867 + * express or implied warranty.
869 + * Wnn consortium is one of distributors of the official Wnn source code
870 + * release. Wnn consortium also makes no representations about the
871 + * suitability of this software for any purpose. It is provided "as is"
872 + * without express or implied warranty.
874 + * KURIMS, OMRON, ASTEC AND WNN CONSORTIUM DISCLAIM ALL WARRANTIES WITH
875 + * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
876 + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KURIMS, OMRON, ASTEC OR
877 + * WNN CONSORTIUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
878 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
879 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
880 + * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
881 + * PERFORMANCE OF THIS SOFTWARE.
887 +/* #include "wnn_malloc.h" */
896 + size = (size + 7) & 0xfffffff8;
897 + return(calloc(size,1));
904 + if(pter == NULL) return;
917 + size = (size + 7) & 0xfffffff8;
919 + return(malloc0(size));
920 + return(realloc(pter,size));