Mercurial > emacs
comparison src/callproc.c @ 24432:a1cd251f7a70
(Fcall_process): Use xmalloc, xfree.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 04 Mar 1999 09:03:31 +0000 |
parents | d11ac02f9d6a |
children | d95c8bcfe8ae |
comparison
equal
deleted
inserted
replaced
24431:00398ed56396 | 24432:a1cd251f7a70 |
---|---|
681 if (process_coding.type == coding_type_no_conversion) | 681 if (process_coding.type == coding_type_no_conversion) |
682 insert (bufptr, nread); | 682 insert (bufptr, nread); |
683 else | 683 else |
684 { /* We have to decode the input. */ | 684 { /* We have to decode the input. */ |
685 int size = decoding_buffer_size (&process_coding, nread); | 685 int size = decoding_buffer_size (&process_coding, nread); |
686 char *decoding_buf = (char *) malloc (size); | 686 char *decoding_buf = (char *) xmalloc (size); |
687 | 687 |
688 decode_coding (&process_coding, bufptr, decoding_buf, | 688 decode_coding (&process_coding, bufptr, decoding_buf, |
689 nread, size); | 689 nread, size); |
690 if (display_on_the_fly | 690 if (display_on_the_fly |
691 && saved_coding.type == coding_type_undecided | 691 && saved_coding.type == coding_type_undecided |
693 { | 693 { |
694 /* We have detected some coding system. But, | 694 /* We have detected some coding system. But, |
695 there's a possibility that the detection was | 695 there's a possibility that the detection was |
696 done by insufficient data. So, we give up | 696 done by insufficient data. So, we give up |
697 displaying on the fly. */ | 697 displaying on the fly. */ |
698 free (decoding_buf); | 698 xfree (decoding_buf); |
699 display_on_the_fly = 0; | 699 display_on_the_fly = 0; |
700 process_coding = saved_coding; | 700 process_coding = saved_coding; |
701 carryover = nread; | 701 carryover = nread; |
702 continue; | 702 continue; |
703 } | 703 } |
704 if (process_coding.produced > 0) | 704 if (process_coding.produced > 0) |
705 insert (decoding_buf, process_coding.produced); | 705 insert (decoding_buf, process_coding.produced); |
706 free (decoding_buf); | 706 xfree (decoding_buf); |
707 carryover = nread - process_coding.consumed; | 707 carryover = nread - process_coding.consumed; |
708 if (carryover > 0) | 708 if (carryover > 0) |
709 { | 709 { |
710 /* As CARRYOVER should not be that large, we had | 710 /* As CARRYOVER should not be that large, we had |
711 better avoid overhead of bcopy. */ | 711 better avoid overhead of bcopy. */ |