changeset 30608:4ec0adbeda9d

(opendir, GetTempDirName, run_mac_command): Use xmalloc instead of malloc. (run_mac_command, closedir): Use `xfree' instead of `free'.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 05 Aug 2000 19:26:46 +0000
parents 7f8793e95bb0
children 6e37e9488e49
files src/sysdep.c
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/sysdep.c	Sat Aug 05 19:26:30 2000 +0000
+++ b/src/sysdep.c	Sat Aug 05 19:26:46 2000 +0000
@@ -3525,7 +3525,7 @@
   BLOCK_INPUT;
   if (fstat (fd, &sbuf) < 0
       || (sbuf.st_mode & S_IFMT) != S_IFDIR
-      || (dirp = (DIR *) malloc (sizeof (DIR))) == 0)
+      || (dirp = (DIR *) xmalloc (sizeof (DIR))) == 0)
     {
       emacs_close (fd);
       UNBLOCK_INPUT;
@@ -6354,7 +6354,7 @@
       else if (mkdir (unixDirName, 0700) != 0)  /* create it if not */
 	return NULL;
 
-      TempDirName = (char *) malloc (strlen (unixDirName) + 1);
+      TempDirName = (char *) xmalloc (strlen (unixDirName) + 1);
       strcpy (TempDirName, unixDirName);
     }
 
@@ -6594,7 +6594,7 @@
 
   /* After expanding all the arguments, we now know the length of the parameter block to be
      sent to the subprocess as a message attached to the HLE. */
-  param = (char *) malloc (paramlen + 1);
+  param = (char *) xmalloc (paramlen + 1);
   if (!param)
     return -1;
 
@@ -6623,7 +6623,7 @@
   iErr = FSMakeFSSpec (0, 0, macappname, &spec);
   
   if (iErr != noErr) {
-    free (param);
+    xfree (param);
     return -1;
   }
 
@@ -6634,10 +6634,11 @@
   lpbr.launchAppParameters = NULL;
 
   iErr = LaunchApplication (&lpbr);  /* call the subprocess */
-  if (iErr != noErr) {
-    free (param);
-    return -1;
-  }
+  if (iErr != noErr)
+    {
+      xfree (param);
+      return -1;
+    }
 
   sendEvent.what = kHighLevelEvent;
   sendEvent.message = kEmacsSubprocessSend;  /* Event ID stored in "where" unused */
@@ -6649,7 +6650,7 @@
   while (iErr == sessClosedErr && retries-- > 0);
 
   if (iErr != noErr) {
-    free (param);
+    xfree (param);
     return -1;
   }
 
@@ -6664,12 +6665,12 @@
   iErr = AcceptHighLevelEvent (&targ, &refCon, NULL, &len);
   if (iErr != noErr) {
     DisposeHandle ((Handle) cursorRegionHdl);
-    free (param);
+    xfree (param);
     return -1;
   }
   
   DisposeHandle ((Handle) cursorRegionHdl);
-  free (param);
+  xfree (param);
 
   return refCon;
 }
@@ -6682,7 +6683,7 @@
   CInfoPBRec cipb;
   int len;
 
-  dirp = (DIR *) malloc (sizeof (DIR));
+  dirp = (DIR *) xmalloc (sizeof (DIR));
   if (!dirp)
     return 0;