gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r4771 - in GNUnet/src: applications/fs/ecrs server


From: gnunet
Subject: [GNUnet-SVN] r4771 - in GNUnet/src: applications/fs/ecrs server
Date: Sun, 22 Apr 2007 22:56:48 -0600 (MDT)

Author: grothoff
Date: 2007-04-22 22:56:48 -0600 (Sun, 22 Apr 2007)
New Revision: 4771

Modified:
   GNUnet/src/applications/fs/ecrs/directory.c
   GNUnet/src/server/connection.c
Log:
fixing resource leaks on error paths

Modified: GNUnet/src/applications/fs/ecrs/directory.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/directory.c 2007-04-23 04:45:57 UTC (rev 
4770)
+++ GNUnet/src/applications/fs/ecrs/directory.c 2007-04-23 04:56:48 UTC (rev 
4771)
@@ -281,13 +281,17 @@
   for (i=0;i<count;i++) {
     perm[i] = i;
     ucs[i] = ECRS_uriToString(fis[i].uri);
-    GE_ASSERT(ectx, ucs[i] != NULL);
+    GE_ASSERT(ectx, 
+             ucs[i] != NULL);
     psize = ECRS_sizeofMetaData(fis[i].meta,
                                ECRS_SERIALIZE_FULL);
     if (psize == -1) {
       GE_BREAK(ectx, 0);
       FREE(sizes);
       FREE(perm);
+      while (i>=0) 
+       FREE(ucs[i--]);
+      FREE(ucs);
       return SYSERR;
     }      
     sizes[i] = psize + sizeof(unsigned int) + strlen(ucs[i]) + 1;

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2007-04-23 04:45:57 UTC (rev 4770)
+++ GNUnet/src/server/connection.c      2007-04-23 04:56:48 UTC (rev 4771)
@@ -1582,6 +1582,7 @@
     /* no messages selected!? */
     GE_BREAK(ectx, 0);
     be->inSendBuffer = NO;
+    FREE(entries);
     return NO;
   }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]