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 #define max(a, b) ((a < b)? b:a)
8 +extern char *malloc0();
12 * Function Name: dic_get_compressed_filename
14 hjt.hindo_area = (int)((serial + MAX_HINDO_DATA_AREA - 1) / MAX_HINDO_DATA_AREA);
15 if(hjt.hindo_area != 0) {
16 if((hjt.curserial = (unsigned char *)
17 - malloc(hjt.hindo_area * sizeof(unsigned char))) == NULL)
18 + malloc0(hjt.hindo_area * sizeof(unsigned char))) == NULL)
20 for(i = 0; i < hjt.hindo_area; i++) (hjt.curserial)[i] = 0;
24 if(hjt1->hindo_area != 0) {
25 if((hjt1->curserial = (unsigned char *)
26 - malloc(hjt1->hindo_area * sizeof(unsigned char))) == NULL)
27 + malloc0(hjt1->hindo_area * sizeof(unsigned char))) == NULL)
29 for(i = 0; i < hjt1->hindo_area; i++)
30 (hjt1->curserial)[i] = vgetc(ifpter, args);
31 diff -uNr Xsi.orig/Wnn/etc/fi_bdic.c Xsi/Wnn/etc/fi_bdic.c
32 --- Xsi.orig/Wnn/etc/fi_bdic.c Wed Oct 28 13:36:17 1998
33 +++ Xsi/Wnn/etc/fi_bdic.c Tue Nov 10 05:17:02 1998
38 +extern char *malloc0();
43 /* ÀܳÄêµÁ£×£î£î¼½ñ f_uniq ÇÛÎó¤ÎÆɤ߹þ¤ß */
45 if((jt1->jisho_uniq = (struct wnn_file_uniq *)
46 - malloc(jt1->maxjisho * sizeof(struct wnn_file_uniq))) == NULL)
47 + malloc0(jt1->maxjisho * sizeof(struct wnn_file_uniq))) == NULL)
49 for(i = 0; i < jt1->maxjisho; i++) {
50 if(input_file_uniq(&((jt1->jisho_uniq)[i]), ifpter, args) == -1)
51 diff -uNr Xsi.orig/Wnn/etc/gethinsi.c Xsi/Wnn/etc/gethinsi.c
52 --- Xsi.orig/Wnn/etc/gethinsi.c Wed Oct 28 13:36:17 1998
53 +++ Xsi/Wnn/etc/gethinsi.c Tue Nov 10 05:12:15 1998
55 extern char *hinsi_file_name;
56 #endif /* !DSERVER && JSERVER */
58 +extern char *malloc0();
66 static int wnn_find_load_hinsi_by_name();
68 - if((hdata = (struct HDT *)malloc(sizeof(struct HDT))) == NULL) {
69 + if((hdata = (struct HDT *)malloc0(sizeof(struct HDT))) == NULL) {
72 hp = heap = hdata->heap;
82 diff -uNr Xsi.orig/Wnn/etc/msg.c Xsi/Wnn/etc/msg.c
83 --- Xsi.orig/Wnn/etc/msg.c Wed Oct 28 13:36:18 1998
84 +++ Xsi/Wnn/etc/msg.c Tue Nov 10 05:13:39 1998
87 extern char *getenv();
89 +extern char *malloc0();
93 bsearch(ky, bs, nel, width, compar)
99 - if (!(cd = (struct msg_cat *)malloc(sizeof(struct msg_cat))))
100 + if (!(cd = (struct msg_cat *)malloc0(sizeof(struct msg_cat))))
103 strcpy(cd->name, name);
106 cd->msg_cnt = msg_cnt;
107 if (!(bd = cd->msg_bd = (struct msg_bd *)
108 - malloc((sizeof(struct msg_bd)) * msg_cnt + msg_byte + 1))) {
109 + malloc0((sizeof(struct msg_bd)) * msg_cnt + msg_byte + 1))) {
115 msg = (char *) bd + (sizeof(struct msg_bd)) * msg_cnt;
118 msg_close(cd->nextp);
128 diff -uNr Xsi.orig/Wnn/jlib/jl.c Xsi/Wnn/jlib/jl.c
129 --- Xsi.orig/Wnn/jlib/jl.c Wed Oct 28 13:36:30 1998
130 +++ Xsi/Wnn/jlib/jl.c Tue Nov 10 05:07:39 1998
132 #include "wnn_string.h"
133 extern struct msg_cat *wnn_msg_cat;
135 +extern char *malloc0();
136 +extern void free0();
137 +extern char *realloc0();
139 #define MAXENVS WNN_MAX_ENV_OF_A_CLIENT
144 register struct wnn_file_name_id *f, *f1;
145 - if((f = (struct wnn_file_name_id *)malloc(sizeof(struct wnn_file_name_id) +
146 + if((f = (struct wnn_file_name_id *)malloc0(sizeof(struct wnn_file_name_id) +
147 strlen(name) + 1)) == NULL){
148 env_wnn_errorno_set=WNN_ALLOC_FAIL;
151 for(prev = &jl_env_p->file; (f = *prev); prev = &f->next){
156 UnlockMutex(&envs_lock);
159 @@ -774,10 +777,10 @@
163 - if(rb.size == 0) rb.buf = (char *)malloc((unsigned)(rb.size = 1024));
164 + if(rb.size == 0) rb.buf = (char *)malloc0((unsigned)(rb.size = 1024));
166 #define ALLOC_SET(pter, type, size, size_var) \
167 - ((pter) = ((type *)malloc((unsigned)(sizeof(type) * ((size_var) = (size))))))
168 + ((pter) = ((type *)malloc0((unsigned)(sizeof(type) * ((size_var) = (size))))))
170 if(!ALLOC_SET(buf, struct wnn_buf_mt, 1, dmy)){
171 wnn_errorno=WNN_ALLOC_FAIL;return NULL;
176 - if((c =(char **)malloc((unsigned)(len * sizeof(WNN_BUN) + sizeof(char *)))) == NULL){
177 + if((c =(char **)malloc0((unsigned)(len * sizeof(WNN_BUN) + sizeof(char *)))) == NULL){
178 buf_wnn_errorno_set=WNN_ALLOC_FAIL;
181 @@ -918,15 +921,15 @@
185 - if(buf->bun) free((char *)buf->bun);
186 - if(buf->zenkouho) free((char *)buf->zenkouho);
187 - if(buf->zenkouho_dai) free((char *)buf->zenkouho_dai);
188 - if(buf->down_bnst) free((char *)buf->down_bnst);
189 + if(buf->bun) free0((char *)buf->bun);
190 + if(buf->zenkouho) free0((char *)buf->zenkouho);
191 + if(buf->zenkouho_dai) free0((char *)buf->zenkouho_dai);
192 + if(buf->down_bnst) free0((char *)buf->down_bnst);
193 for(c = buf->heap; c; c = next) {
199 + free0((char *)buf);
200 UnlockMutex(&(tmpbuf.buf_lock));
203 @@ -1027,11 +1030,11 @@
207 - hno = (int *)malloc(hsize * sizeof(int));
208 + hno = (int *)malloc0(hsize * sizeof(int));
209 for(i = 0; i < hsize; i++) {
210 _Sstrcpy(tmp, hname[i]);
211 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
213 + free0((char *)hno);
214 UnlockMutex(&BUF_LOCK(buf));
217 @@ -1040,7 +1043,7 @@
219 x = ren_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep,
221 - if(nhinsi) free((char *)hno);
222 + if(nhinsi) free0((char *)hno);
223 UnlockMutex(&BUF_LOCK(buf));
225 } /* End of jl_ren_conv_with_hinsi_name */
226 @@ -1422,11 +1425,11 @@
230 - hno = (int *)malloc(hsize * sizeof(int));
231 + hno = (int *)malloc0(hsize * sizeof(int));
232 for(i = 0; i < hsize; i++) {
233 _Sstrcpy(tmp, hname[i]);
234 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
236 + free0((char *)hno);
237 UnlockMutex(&BUF_LOCK(buf));
240 @@ -1435,11 +1438,11 @@
242 if(tan_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep,
243 ich_shop, 0, nhinsi, hno) == -1) {
244 - if(nhinsi) free((char *)hno);
245 + if(nhinsi) free0((char *)hno);
246 UnlockMutex(&BUF_LOCK(buf));
249 - if(nhinsi) free((char *)hno);
250 + if(nhinsi) free0((char *)hno);
252 UnlockMutex(&BUF_LOCK(buf));
254 @@ -1767,11 +1770,11 @@
258 - hno = (int *)malloc(hsize * sizeof(int));
259 + hno = (int *)malloc0(hsize * sizeof(int));
260 for(i = 0; i < hsize; i++) {
261 _Sstrcpy(tmp, hname[i]);
262 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
264 + free0((char *)hno);
265 UnlockMutex(&BUF_LOCK(buf));
268 @@ -1780,11 +1783,11 @@
270 if(nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop,
271 nhinsi, hno, 0) == -1) {
272 - if(nhinsi) free((char *)hno);
273 + if(nhinsi) free0((char *)hno);
274 UnlockMutex(&BUF_LOCK(buf));
277 - if(nhinsi) free((char *)hno);
278 + if(nhinsi) free0((char *)hno);
280 UnlockMutex(&BUF_LOCK(buf));
282 @@ -2206,18 +2209,18 @@
286 - hno = (int *)malloc(hsize * sizeof(int));
287 + hno = (int *)malloc0(hsize * sizeof(int));
288 for(i = 0; i < hsize; i++) {
289 _Sstrcpy(tmp, hname[i]);
290 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
292 + free0((char *)hno);
293 UnlockMutex(&BUF_LOCK(buf));
298 x = zen_conv_sho1(buf, bun_no, use_maep, uniq_level, 0, nhinsi, hno);
299 - if(nhinsi) free((char *)hno);
300 + if(nhinsi) free0((char *)hno);
301 UnlockMutex(&BUF_LOCK(buf));
304 @@ -2431,18 +2434,18 @@
308 - hno = (int *)malloc(hsize * sizeof(int));
309 + hno = (int *)malloc0(hsize * sizeof(int));
310 for(i = 0; i < hsize; i++) {
311 _Sstrcpy(tmp, hname[i]);
312 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
314 + free0((char *)hno);
315 UnlockMutex(&BUF_LOCK(buf));
320 x = zen_conv_dai1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, nhinsi, hno);
321 - if(nhinsi) free((char *)hno);
322 + if(nhinsi) free0((char *)hno);
323 UnlockMutex(&BUF_LOCK(buf));
326 @@ -3175,46 +3178,46 @@
327 /* Á°³ÎÄêʸÀá¾ðÊóʬ¤ò³ÎÄê¸õÊä¿ô¤Ë²Ã¤¨¤ë */
328 nkouho = bun_no2 - bun_no + WNN_PREV_BUN_SUU;
330 - if ( (dic = (int *)malloc(nkouho * sizeof(int))) == NULL )
331 + if ( (dic = (int *)malloc0(nkouho * sizeof(int))) == NULL )
334 - if ( (entry = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
336 + if ( (entry = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
340 - if ( (ima = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
343 + if ( (ima = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
348 - if ( (hindo = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
352 + if ( (hindo = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
358 - if ( (kmoji = (int *)malloc(nkouho * sizeof(int))) == NULL ) {
363 + if ( (kmoji = (int *)malloc0(nkouho * sizeof(int))) == NULL ) {
370 - if ( (kouho = (w_char **)malloc(nkouho * sizeof(w_char *))) == NULL ) {
376 + if ( (kouho = (w_char **)malloc0(nkouho * sizeof(w_char *))) == NULL ) {
384 - if ( (tmp = (w_char *)malloc(nkouho * sizeof(w_char) * LENGTHKANJI)) == NULL ) {
391 + if ( (tmp = (w_char *)malloc0(nkouho * sizeof(w_char) * LENGTHKANJI)) == NULL ) {
400 for(k = 0; k < nkouho; k++) {
401 @@ -3280,23 +3283,23 @@
403 buf_wnn_errorno_copy((WNN_BUF_MT *)buf)
404 if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) {
437 } /* End of optimize_in_server */
439 @@ -4482,7 +4485,7 @@
440 if(--wb->ref_cnt <= 0){
442 if((wb1 == wb) && (wb->hinsi_list != NULL)) {
443 - free((char *)(wb->hinsi_list));
444 + free0((char *)(wb->hinsi_list));
445 wb->hinsi_list = NULL;
447 wb->free_next = buf->orig.free_heap;
448 @@ -4593,7 +4596,7 @@
449 wb->num_hinsi = nhinsi;
451 int hsize = abs(nhinsi) * sizeof(int);
452 - if((wb->hinsi_list = (int *)malloc(hsize)) == NULL) return(NULL);
453 + if((wb->hinsi_list = (int *)malloc0(hsize)) == NULL) return(NULL);
454 bcopy(hlist, wb->hinsi_list, hsize);
456 wb->hinsi_list = NULL;
457 @@ -4660,7 +4663,7 @@
459 newsize = buf->orig.bun_suu + cnt - (bun_no2 - bun_no);
461 -#define Realloc(a, b) realloc((char *)(a), (unsigned)(b))
462 +#define Realloc(a, b) realloc0((char *)(a), (unsigned)(b))
464 if(newsize > buf->orig.msize_bun){
465 buf->orig.bun = (WNN_BUN **)Realloc(buf->orig.bun, newsize * sizeof(WNN_BUN *));
466 @@ -5012,7 +5015,7 @@
475 @@ -5387,10 +5390,10 @@
486 } /* End of jl_free */
488 @@ -6213,22 +6216,22 @@
489 int ii, *hlist, nhinsi = num - 1;
492 - if(!(hlist = (int *)malloc(nhinsi * sizeof(int))))
493 + if(!(hlist = (int *)malloc0(nhinsi * sizeof(int))))
495 for(ii = 0; ii < nhinsi; ii++) {
496 _Sstrcpy(whname, s[ii]);
498 jl_hinsi_number_e_body(env, whname)) == -1) {
499 - free((char *)hlist);
500 + free0((char *)hlist);
504 if(strcmp(code, "unuse_hinsi") == 0) nhinsi *= -1;
505 if(js_set_henkan_hinsi(env, 1, nhinsi, hlist) < 0) {
506 - free((char *)hlist);
507 + free0((char *)hlist);
510 - free((char *)hlist);
511 + free0((char *)hlist);
515 @@ -6974,11 +6977,11 @@
519 - hno = (int *)malloc(hsize * sizeof(int));
520 + hno = (int *)malloc0(hsize * sizeof(int));
521 for(i = 0; i < hsize; i++) {
522 _Sstrcpy(tmp, hname[i]);
523 if((hno[i] = jl_hinsi_number_e_body(env, tmp)) == -1) {
525 + free0((char *)hno);
529 @@ -6987,10 +6990,10 @@
530 if((x = js_set_henkan_hinsi(env, mode, nhinsi, hno)) == -1) {
531 env_wnn_errorno_copy(env);
532 if_dead_disconnect(env);
533 - if(nhinsi) free((char *)hno);
534 + if(nhinsi) free0((char *)hno);
537 - if(nhinsi) free((char *)hno);
538 + if(nhinsi) free0((char *)hno);
542 @@ -8164,7 +8167,7 @@
543 if (!buf || !buf->bun || !(data = buf->bun[bun_no])) return(-1);
544 if (js_dic_info(buf->env, data->dic_no, &dic) < 0)
546 - if (!(yomi = (w_char *)malloc(sizeof(w_char) * (data->yomilen + 1))))
547 + if (!(yomi = (w_char *)malloc0(sizeof(w_char) * (data->yomilen + 1))))
549 wnn_Strncpy(yomi, data->yomi, data->yomilen);
550 yomi[data->yomilen] = (w_char)0;
551 @@ -8191,12 +8194,12 @@
552 InfoShoRec *info, *prev;
554 if (max <= 0) return(NULL);
555 - if (!(info = (InfoShoRec *)malloc(sizeof(InfoShoRec) * max))) return(NULL);
556 + if (!(info = (InfoShoRec *)malloc0(sizeof(InfoShoRec) * max))) return(NULL);
557 bzero((char *)info, sizeof(InfoShoRec) * max);
559 for (i = 0; i < max; i++) {
560 if (Sho_Info(buf, i, &info[i]) < 0) {
561 - free((char *)info);
562 + free0((char *)info);
566 @@ -8214,7 +8217,7 @@
569 if (!p) return(NULL);
570 - if (!(info = (InfoTotalRec *)malloc(sizeof(InfoTotalRec)))) return(NULL);
571 + if (!(info = (InfoTotalRec *)malloc0(sizeof(InfoTotalRec)))) return(NULL);
572 bzero((char *)info, sizeof(InfoTotalRec));
574 for (; p; p = p->next) {
575 @@ -8243,7 +8246,7 @@
578 if (cnt <= 0) return(NULL);
579 - if (!(info = (InfoDaiRec *)malloc(sizeof(InfoDaiRec) * cnt))) return(NULL);
580 + if (!(info = (InfoDaiRec *)malloc0(sizeof(InfoDaiRec) * cnt))) return(NULL);
581 bzero((char *)info, sizeof(InfoDaiRec) * cnt);
584 @@ -8585,18 +8588,18 @@
588 - hno = (int *)malloc(hsize * sizeof(int));
589 + hno = (int *)malloc0(hsize * sizeof(int));
590 for(i = 0; i < hsize; i++) {
591 _Sstrcpy(tmp, hname[i]);
592 if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) {
594 + free0((char *)hno);
595 UnlockMutex(&BUF_LOCK(buf));
600 x = zen_conv_dai_ikeiji1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, nhinsi, hno);
601 - if(nhinsi) free((char *)hno);
602 + if(nhinsi) free0((char *)hno);
603 UnlockMutex(&BUF_LOCK(buf));
606 diff -uNr Xsi.orig/Wnn/jlib/js.c Xsi/Wnn/jlib/js.c
607 --- Xsi.orig/Wnn/jlib/js.c Wed Oct 28 13:36:31 1998
608 +++ Xsi/Wnn/jlib/js.c Tue Nov 10 05:04:13 1998
613 -extern char *malloc();
614 +extern char *malloc0();
615 +extern void free0();
616 +extern char *realloc0();
621 #include "../etc/pwd.c"
627 typedef struct _host_address {
631 if (!(sp = getservbyname(name,"tcp"))) return(-1);
633 - if (!(p = (my_serv_struct *)malloc(sizeof(my_serv_struct) + len + 1)))
634 + if (!(p = (my_serv_struct *)malloc0(sizeof(my_serv_struct) + len + 1)))
636 p->name = ((char *)p) + sizeof(my_serv_struct);
637 strcpy(p->name, name);
641 sbp=0; /* init sndBufPointer */
642 - if(!(new_js=(char *)malloc(sizeof(WNN_JSERVER_ID_INT)))){
643 + if(!(new_js=(char *)malloc0(sizeof(WNN_JSERVER_ID_INT)))){
644 js_wnn_errorno_set=WNN_ALLOC_FAIL;
648 server->js_dead_env_flg= 0;
649 if((current_sd= cd_open_in_by_addr(addr, addrlen, port, tmout))==-1){
650 js_wnn_errorno_set = WNN_NO_JSERVER;
651 - free((char*)server);
652 + free0((char*)server);
658 UnlockMutex(&msg_lock);
660 - if(!(new_js=(char *)malloc(sizeof(WNN_JSERVER_ID_INT)))){
661 + if(!(new_js=(char *)malloc0(sizeof(WNN_JSERVER_ID_INT)))){
662 wnn_errorno=WNN_ALLOC_FAIL;
667 if((current_sd= cd_open(lang))==-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;
675 host[WNN_HOSTLEN-1] = '\0'; /* truncate by WNN_HOSTLEN */
676 if((current_sd= cd_open_in(servername, lang, tmout))==-1){
677 UnlockMutex(&open_lock);
678 - wnn_errorno=WNN_SOCK_OPEN_FAIL;free((char*)current_js);current_js=NULL;
679 + wnn_errorno=WNN_SOCK_OPEN_FAIL;free0((char*)current_js);current_js=NULL;
683 @@ -1036,7 +1038,7 @@
685 if(server==0) return(-1);
686 tmp_js_id = *(WNN_JSERVER_ID_INT *)server;
687 - free((char *)server);
688 + free0((char *)server);
689 current_js = &tmp_js_id;
690 server = (WNN_JSERVER_ID *)current_js;
691 set_current_js(server);
692 @@ -1074,7 +1076,7 @@
695 set_current_js(server);
696 - if(!(env=(struct wnn_env_int *)malloc(sizeof(struct wnn_env_int)))){
697 + if(!(env=(struct wnn_env_int *)malloc0(sizeof(struct wnn_env_int)))){
698 js_wnn_errorno_set=WNN_ALLOC_FAIL;
701 @@ -1082,14 +1084,14 @@
702 handler_of_jserver_dead(server);
703 if(js_wnn_errorno_eql) {
704 UnlockMutex(&(server_js_lock));
709 snd_head(JS_CONNECT, server);
710 putscom(env_name, server);
712 e_id=get4com(server);
713 - if(e_id==-1){ js_wnn_errorno_set= get4com(server); free(env); return NULL; }
714 + if(e_id==-1){ js_wnn_errorno_set= get4com(server); free0(env); return NULL; }
715 UnlockMutex(&(server_js_lock));
716 env->orig.env_id = e_id;
717 env->orig.js_id = (WNN_JSERVER_ID *)server;
718 @@ -1188,7 +1190,7 @@
719 if(env==0) return(-1);
720 /* ËÜÍè¤Ï¡¢free ¤·¤Ê¤¤ã¤¢¤«¤ó¤Î¤À¤±¤É¡¢¥ê¥½¡¼¥¹´ÉÍý¤¬½ÐÍè¤Ê¤¤¤·¡¢
721 ¤Þ¤¢¡¢8¥Ð¥¤¥È¤À¤«¤é¡¢¥´¥ß¤¬»Ä¤ë¤±¤É¤¤¤¤¤À¤í¤¦¡£
723 + free0((char *)env);
725 set_current_js(env->js_id);
726 LockMutex(&(env_js_lock));
727 @@ -1581,7 +1583,7 @@
728 UnlockMutex(&(env_js_lock)); return -1;
730 *nhinsi = get4com(env->js_id);
731 - if(((*hlist) = (int *)malloc(abs(*nhinsi) * sizeof(int))) == NULL) {
732 + if(((*hlist) = (int *)malloc0(abs(*nhinsi) * sizeof(int))) == NULL) {
734 for(i = 0; i < abs(*nhinsi); i++) dummy = get4com(env->js_id);
735 env_wnn_errorno_set = WNN_ALLOC_FAIL;
736 @@ -2839,7 +2841,7 @@
737 *curfzk = get4com(server);
739 /* ¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤÎÎΰè¤ò³ÎÊݤ¹¤ë */
740 - if(((*ret) = (WNN_FZK_INFO *)malloc((count + 1) *
741 + if(((*ret) = (WNN_FZK_INFO *)malloc0((count + 1) *
742 sizeof(WNN_FZK_INFO))) == NULL) {
744 for(i = 0; i < count; i++){
745 @@ -3724,13 +3726,13 @@
746 if(ret->size < ret->num + fi_num) {
747 /* ¿·¤¿¤Ë£Æ£É´Ø·¸¥Ç¡¼¥¿¹½Â¤ÂÎÇÛÎó¤ò³ÎÊݤ¹¤ë */
748 fi_data = (struct fi_rel_data *)
749 - malloc((ret->num + fi_num) * sizeof(struct fi_rel_data));
750 + malloc0((ret->num + fi_num) * sizeof(struct fi_rel_data));
752 /* ´û¤Ë»ÈÍѤ·¤Æ¤¤¤¿£Æ£É´Ø·¸¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë */
755 bcopy(ret->fi_buf, fi_data, ret->num * sizeof(struct fi_rel_data));
756 - free((char *)ret->fi_buf);
757 + free0((char *)ret->fi_buf);
760 ret->fi_buf = fi_data;
761 @@ -3962,8 +3964,8 @@
763 if(ret->size < size){
765 - free((char *)ret->buf);
766 - ret->buf = malloc(size);
767 + free0((char *)ret->buf);
768 + ret->buf = malloc0(size);
772 @@ -4263,7 +4265,7 @@
773 funiq.createhost[i]=get1com(env->js_id);
775 njisho = get1com(env->js_id);
776 - if((primary = (int *)malloc(njisho * sizeof(int))) == NULL) {
777 + if((primary = (int *)malloc0(njisho * sizeof(int))) == NULL) {
778 env_wnn_errorno_set = WNN_MALLOC_ERR;
779 UnlockMutex(&(env_js_lock));
781 @@ -4271,12 +4273,12 @@
782 for(i = 0; i < njisho; i++)
783 primary[i] = get4com(env->js_id);
784 if(create_fi_hindo_file(&funiq,fn,com,hpasswd,njisho,primary,NULL) == -1){
787 env_wnn_errorno_set = WNN_FILE_CREATE_ERROR;
788 UnlockMutex(&(env_js_lock));
793 UnlockMutex(&(env_js_lock));
795 } /* End of js_fi_hindo_file_create_client */
796 @@ -4563,7 +4565,7 @@
799 if (num == 0) return(0);
800 - if (!(l = (char **)(s = malloc((sizeof(char *) * num) + total)))) {
801 + if (!(l = (char **)(s = malloc0((sizeof(char *) * num) + total)))) {
802 js_wnn_errorno_set = WNN_MALLOC_ERR;
805 @@ -4897,7 +4899,7 @@
806 UnlockMutex(&(server_js_lock));
807 return((char **)NULL);
809 - if (!(save = p = malloc((sizeof(host_address) * total_num) + bytes))) {
810 + if (!(save = p = malloc0((sizeof(host_address) * total_num) + bytes))) {
811 for (i = 0; i < bytes; i++) get1com(server);
812 js_wnn_errorno_set = WNN_MALLOC_ERR;
813 return((char **)NULL);
814 @@ -4931,8 +4933,8 @@
816 total += get_host_name_len(host_p);
818 - if (!(p = malloc((sizeof(char *) * total_num) + total + total_num))) {
819 - free((char *)save);
820 + if (!(p = malloc0((sizeof(char *) * total_num) + total + total_num))) {
821 + free0((char *)save);
822 js_wnn_errorno_set = WNN_MALLOC_ERR;
823 UnlockMutex(&(server_js_lock));
824 return((char **)NULL);
825 @@ -4947,7 +4949,7 @@
827 p += get_host_name(host_p, p) + 1;
829 - free((char *)save);
830 + free0((char *)save);
831 *ret_num = total_num;
832 UnlockMutex(&(server_js_lock));
834 @@ -5449,5 +5451,6 @@
837 /* end of js_ikeiji_with_data */
841 diff -uNr Xsi.orig/Wnn/jlib/malloc.c Xsi/Wnn/jlib/malloc.c
842 --- Xsi.orig/Wnn/jlib/malloc.c Thu Jan 1 09:00:00 1970
843 +++ Xsi/Wnn/jlib/malloc.c Tue Nov 10 04:58:00 1998
849 + * Copyright Kyoto University Research Institute for Mathematical Sciences
850 + * 1987, 1988, 1989, 1990, 1991
851 + * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991
852 + * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991
854 + * Permission to use, copy, modify, distribute, and sell this software
855 + * and its documentation for any purpose is hereby granted without fee,
856 + * provided that all of the following conditions are satisfied:
858 + * 1) The above copyright notices appear in all copies
859 + * 2) Both those copyright notices and this permission notice appear
860 + * in supporting documentation
861 + * 3) The name of "Wnn" isn't changed unless substantial modifications
863 + * 3') Following words followed by the above copyright notices appear
864 + * in all supporting documentation of software based on "Wnn":
866 + * "This software is based on the original version of Wnn developed by
867 + * Kyoto University Research Institute for Mathematical Sciences (KURIMS),
868 + * OMRON Corporation and ASTEC Inc."
870 + * 4) The names KURIMS, OMRON and ASTEC not be used in advertising or
871 + * publicity pertaining to distribution of the software without
872 + * specific, written prior permission
874 + * KURIMS, OMRON and ASTEC make no representations about the suitability
875 + * of this software for any purpose. It is provided "as is" without
876 + * express or implied warranty.
878 + * Wnn consortium is one of distributors of the official Wnn source code
879 + * release. Wnn consortium also makes no representations about the
880 + * suitability of this software for any purpose. It is provided "as is"
881 + * without express or implied warranty.
883 + * KURIMS, OMRON, ASTEC AND WNN CONSORTIUM DISCLAIM ALL WARRANTIES WITH
884 + * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
885 + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KURIMS, OMRON, ASTEC OR
886 + * WNN CONSORTIUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
887 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
888 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
889 + * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
890 + * PERFORMANCE OF THIS SOFTWARE.
896 +/* #include "wnn_malloc.h" */
901 +extern char *malloc();
903 +extern char *realloc();
904 +extern char *calloc();
913 + size = (size + 7) & 0xfffffff8;
914 + return(calloc(size,1));
921 + if(pter == NULL) return;
934 + size = (size + 7) & 0xfffffff8;
936 + return(malloc0(size));
937 + return(realloc(pter,size));