aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-08-05 19:26:46 +0000
committerGerd Moellmann2000-08-05 19:26:46 +0000
commit7f77dbe3b0f46f9c769b5d7a226849ee3db05b38 (patch)
treebbb0a029466e3a71d0a39320d2ddf2b677f5b8ea /src
parenta3f0666ff72f8f226766428ef5cae5fcefb5274f (diff)
downloademacs-7f77dbe3b0f46f9c769b5d7a226849ee3db05b38.tar.gz
emacs-7f77dbe3b0f46f9c769b5d7a226849ee3db05b38.zip
(opendir, GetTempDirName, run_mac_command): Use xmalloc
instead of malloc. (run_mac_command, closedir): Use `xfree' instead of `free'.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 39973d6cbd7..c4f9991af45 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -3525,7 +3525,7 @@ opendir (filename)
3525 BLOCK_INPUT; 3525 BLOCK_INPUT;
3526 if (fstat (fd, &sbuf) < 0 3526 if (fstat (fd, &sbuf) < 0
3527 || (sbuf.st_mode & S_IFMT) != S_IFDIR 3527 || (sbuf.st_mode & S_IFMT) != S_IFDIR
3528 || (dirp = (DIR *) malloc (sizeof (DIR))) == 0) 3528 || (dirp = (DIR *) xmalloc (sizeof (DIR))) == 0)
3529 { 3529 {
3530 emacs_close (fd); 3530 emacs_close (fd);
3531 UNBLOCK_INPUT; 3531 UNBLOCK_INPUT;
@@ -6354,7 +6354,7 @@ GetTempDirName ()
6354 else if (mkdir (unixDirName, 0700) != 0) /* create it if not */ 6354 else if (mkdir (unixDirName, 0700) != 0) /* create it if not */
6355 return NULL; 6355 return NULL;
6356 6356
6357 TempDirName = (char *) malloc (strlen (unixDirName) + 1); 6357 TempDirName = (char *) xmalloc (strlen (unixDirName) + 1);
6358 strcpy (TempDirName, unixDirName); 6358 strcpy (TempDirName, unixDirName);
6359 } 6359 }
6360 6360
@@ -6594,7 +6594,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn)
6594 6594
6595 /* After expanding all the arguments, we now know the length of the parameter block to be 6595 /* After expanding all the arguments, we now know the length of the parameter block to be
6596 sent to the subprocess as a message attached to the HLE. */ 6596 sent to the subprocess as a message attached to the HLE. */
6597 param = (char *) malloc (paramlen + 1); 6597 param = (char *) xmalloc (paramlen + 1);
6598 if (!param) 6598 if (!param)
6599 return -1; 6599 return -1;
6600 6600
@@ -6623,7 +6623,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn)
6623 iErr = FSMakeFSSpec (0, 0, macappname, &spec); 6623 iErr = FSMakeFSSpec (0, 0, macappname, &spec);
6624 6624
6625 if (iErr != noErr) { 6625 if (iErr != noErr) {
6626 free (param); 6626 xfree (param);
6627 return -1; 6627 return -1;
6628 } 6628 }
6629 6629
@@ -6634,10 +6634,11 @@ run_mac_command (argv, workdir, infn, outfn, errfn)
6634 lpbr.launchAppParameters = NULL; 6634 lpbr.launchAppParameters = NULL;
6635 6635
6636 iErr = LaunchApplication (&lpbr); /* call the subprocess */ 6636 iErr = LaunchApplication (&lpbr); /* call the subprocess */
6637 if (iErr != noErr) { 6637 if (iErr != noErr)
6638 free (param); 6638 {
6639 return -1; 6639 xfree (param);
6640 } 6640 return -1;
6641 }
6641 6642
6642 sendEvent.what = kHighLevelEvent; 6643 sendEvent.what = kHighLevelEvent;
6643 sendEvent.message = kEmacsSubprocessSend; /* Event ID stored in "where" unused */ 6644 sendEvent.message = kEmacsSubprocessSend; /* Event ID stored in "where" unused */
@@ -6649,7 +6650,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn)
6649 while (iErr == sessClosedErr && retries-- > 0); 6650 while (iErr == sessClosedErr && retries-- > 0);
6650 6651
6651 if (iErr != noErr) { 6652 if (iErr != noErr) {
6652 free (param); 6653 xfree (param);
6653 return -1; 6654 return -1;
6654 } 6655 }
6655 6656
@@ -6664,12 +6665,12 @@ run_mac_command (argv, workdir, infn, outfn, errfn)
6664 iErr = AcceptHighLevelEvent (&targ, &refCon, NULL, &len); 6665 iErr = AcceptHighLevelEvent (&targ, &refCon, NULL, &len);
6665 if (iErr != noErr) { 6666 if (iErr != noErr) {
6666 DisposeHandle ((Handle) cursorRegionHdl); 6667 DisposeHandle ((Handle) cursorRegionHdl);
6667 free (param); 6668 xfree (param);
6668 return -1; 6669 return -1;
6669 } 6670 }
6670 6671
6671 DisposeHandle ((Handle) cursorRegionHdl); 6672 DisposeHandle ((Handle) cursorRegionHdl);
6672 free (param); 6673 xfree (param);
6673 6674
6674 return refCon; 6675 return refCon;
6675} 6676}
@@ -6682,7 +6683,7 @@ opendir (const char *dirname)
6682 CInfoPBRec cipb; 6683 CInfoPBRec cipb;
6683 int len; 6684 int len;
6684 6685
6685 dirp = (DIR *) malloc (sizeof (DIR)); 6686 dirp = (DIR *) xmalloc (sizeof (DIR));
6686 if (!dirp) 6687 if (!dirp)
6687 return 0; 6688 return 0;
6688 6689