[Mit-cadr-cvs] r391 - branches/ggilley/emulator/usim

ggilley at common-lisp.net ggilley at common-lisp.net
Wed Dec 5 03:13:29 UTC 2012


Author: ggilley
Date: Tue Dec  4 19:13:28 2012
New Revision: 391

Log:
fix a couple of bugs

Modified:
   branches/ggilley/emulator/usim/Files.c
   branches/ggilley/emulator/usim/glob.c

Modified: branches/ggilley/emulator/usim/Files.c
==============================================================================
--- branches/ggilley/emulator/usim/Files.c	Tue Dec  4 09:44:35 2012	(r390)
+++ branches/ggilley/emulator/usim/Files.c	Tue Dec  4 19:13:28 2012	(r391)
@@ -805,7 +805,10 @@
         
         packet = chaos_connection_dequeue(conn);
         if (packet == 0)
+        {
+            tfree(t);
             return NULL;
+        }
 
         t->t_packet = packet;
         t->t_connection = conn;

Modified: branches/ggilley/emulator/usim/glob.c
==============================================================================
--- branches/ggilley/emulator/usim/glob.c	Tue Dec  4 09:44:35 2012	(r390)
+++ branches/ggilley/emulator/usim/glob.c	Tue Dec  4 19:13:28 2012	(r391)
@@ -751,7 +751,7 @@
     register char **nv = (char **)malloc((size_t)(((size_t)blklen(v) + 1) *
                                                     sizeof(char **)));
     if (nv == (char **)0)
-        fatal(NOMEM);
+        return 0;
     
     register char **av = v;
     
@@ -762,6 +762,8 @@
         while (*av)
         {
             *bv = malloc(strlen(*av) + 1);
+            if (*bv == 0)
+                return 0;
             strcpy(*bv, *av);
             av++;
             bv++;




More information about the mit-cadr-cvs mailing list