OSSP CVS Repository

ossp - Difference in ossp-pkg/cfg/cfg_node.c versions 1.10 and 1.11
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/cfg/cfg_node.c 1.10 -> 1.11

--- cfg_node.c   2002/07/17 14:35:09     1.10
+++ cfg_node.c   2002/07/17 14:39:57     1.11
@@ -39,11 +39,12 @@
 cfg_rc_t cfg_node_create(cfg_t *cfg, cfg_node_t **node)
 {
     cfg_node_t *n;
+    cfg_rc_t rc;
 
     if (node == NULL)
         return CFG_ERR_ARG;
-    if ((n = malloc(sizeof(cfg_node_t))) == NULL)
-        return CFG_ERR_SYS;
+    if ((rc = cfg_grid_alloc(cfg->grid_nodes, (void **)&n)) != CFG_OK)
+        return rc;
     n->parent   = NULL;
     n->lbroth   = NULL;
     n->rbroth   = NULL;
@@ -65,18 +66,19 @@
         free(node->token);
     if (node->srcname != NULL)
         free(node->srcname);
-    free(node);
+    cfg_grid_free(cfg->grid_nodes, node);
     return CFG_OK;
 }
 
 cfg_rc_t cfg_node_clone(cfg_t *cfg, cfg_node_t *node, cfg_node_t **node2)
 {
     cfg_node_t *n;
+    cfg_rc_t rc;
 
     if (node == NULL || node2 == NULL)
         return CFG_ERR_ARG;
-    if ((n = malloc(sizeof(cfg_node_t))) == NULL)
-        return CFG_ERR_SYS;
+    if ((rc = cfg_grid_alloc(cfg->grid_nodes, (void **)&n)) != CFG_OK)
+        return rc;
     n->parent   = node->parent;
     n->lbroth   = node->lbroth;
     n->rbroth   = node->rbroth;

CVSTrac 2.0.1