OSSP CVS Repository

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

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

--- cfg_test.c   2002/11/18 09:51:29     1.10
+++ cfg_test.c   2002/11/18 10:23:36     1.11
@@ -42,24 +42,24 @@
         cfg_destroy(cfg);
         exit(1);
     }
+    free(im_ptr);
 
     if ((rc = cfg_export(cfg, NULL, CFG_FMT_CFG, &ex_ptr, 0)) != CFG_OK) {
         cfg_error(cfg, rc, &error);
         fprintf(stderr, "ERROR: cfg_export: %s\n", error);
-        free(im_ptr);
         cfg_destroy(cfg);
         exit(1);
     }
 
     fprintf(stdout, "%s", ex_ptr);
     fflush(stdout);
+    free(ex_ptr);
 
     if (argc == 3) {
         if ((rc = cfg_node_select(cfg, NULL, &vec, "%s", argv[2])) != CFG_OK) {
             cfg_error(cfg, rc, &error);
             fprintf(stderr, "ERROR: cfg_node_select: %s\n", error);
-            free(im_ptr);
-            /*cfg_destroy(cfg);*/
+            cfg_destroy(cfg);
             exit(1);
         }
         for (i = 1; vec[i] != NULL; i++) {
@@ -67,19 +67,16 @@
             if ((rc = cfg_export(cfg, vec[i], CFG_FMT_CFG, &ex_ptr, 0)) != CFG_OK) {
                 cfg_error(cfg, rc, &error);
                 fprintf(stderr, "ERROR: cfg_export: %s\n", error);
-                free(im_ptr);
-                /*cfg_destroy(cfg);*/
+                cfg_destroy(cfg);
                 exit(1);
             }
             fprintf(stdout, "%s", ex_ptr);
             fprintf(stdout, "---- selection #%d ----\n", i);
+            free(ex_ptr);
         }
     }
 
-#if 0
-    cfg_syn_destroy(cfg, node);
     cfg_destroy(cfg);
-#endif
 
     return 0;
 }

CVSTrac 2.0.1