Index: ossp-pkg/xds/destroy.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/destroy.c,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/xds/Attic/destroy.c,v' 2>/dev/null --- 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); } Index: ossp-pkg/xds/init.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/init.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/xds/Attic/init.c,v' 2>/dev/null --- 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;