OSSP CVS Repository

ossp - Check-in [4161]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4161
Date: 2001-Jul-08 16:21:08 (local)
2001-Jul-08 14:21:08 (UTC)
User:simons
Branch:
Comment: xds_init() and xds_destroy() will now initialize and destroy the engines array in the context, too.
Tickets:
Inspections:
Files:
ossp-pkg/xds/destroy.c      1.3 -> 1.4     9 inserted, 4 deleted
ossp-pkg/xds/init.c      1.2 -> 1.3     10 inserted, 0 deleted

ossp-pkg/xds/destroy.c 1.3 -> 1.4

--- destroy.c    2001/07/08 14:08:16     1.3
+++ destroy.c    2001/07/08 14:21:08     1.4
@@ -31,9 +31,14 @@
 
 void xds_destroy(xds_t* xds)
     {
+    /* Sanity checks. */
+
     assert(xds != NULL);
-    if (xds != NULL)
-        {
-        free(xds);
-        }
+    if (xds == NULL)
+        return;
+
+    /* Free allocated memory. */
+
+    free(xds->engines);
+    free(xds);
     }


ossp-pkg/xds/init.c 1.2 -> 1.3

--- init.c       2001/07/04 16:21:26     1.2
+++ init.c       2001/07/08 14:21:08     1.3
@@ -53,6 +53,16 @@
 
     ctx->mode = mode;
 
+    /* Allocate engines array. */
+
+    ctx->engines = calloc(32, sizeof(engine_map_t));
+    if (ctx->engines == NULL)
+        {
+        free(ctx);
+        return NULL;
+        }
+    ctx->engines_capacity = 32;
+
     /* We are initialized. */
 
     return ctx;

CVSTrac 2.0.1