Revision: 45791
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45791&view=rev
Author:   brlcad
Date:     2011-08-05 16:04:17 +0000 (Fri, 05 Aug 2011)

Log Message:
-----------
eek, wasn't using libbu memory management.  call libbu and free dynamically 
allocated memory.

Modified Paths:
--------------
    brlcad/trunk/src/proc-db/sphflake.c

Modified: brlcad/trunk/src/proc-db/sphflake.c
===================================================================
--- brlcad/trunk/src/proc-db/sphflake.c 2011-08-05 15:56:03 UTC (rev 45790)
+++ brlcad/trunk/src/proc-db/sphflake.c 2011-08-05 16:04:17 UTC (rev 45791)
@@ -193,8 +193,8 @@
 
     /* initialize the wmember structs...
        this is for creating the regions */
-    wmemberArray = (struct wmember *)malloc(sizeof(struct wmember)
-                                           
*(params.maxDepth+1+ADDITIONAL_OBJECTS));
+    wmemberArray = (struct wmember *)bu_malloc(sizeof(struct wmember)
+                                              
*(params.maxDepth+1+ADDITIONAL_OBJECTS), "alloc wmemberArray");
     for (i = 0; i <= params.maxDepth+ADDITIONAL_OBJECTS; i++) {
        BU_LIST_INIT(&(wmemberArray[i].l));
     }
@@ -223,7 +223,11 @@
 
     createScene(&params);
 
+
+    /* clean up */
     wdb_close(fp);
+    bu_free(wmemberArray, "free wmemberArray");
+    bu_free(params.matArray, "free matArray");
 
     return 0;
 }
@@ -258,7 +262,7 @@
     p->pos[Y] = DEFAULT_ORIGIN_Y;
     p->pos[Z] = DEFAULT_ORIGIN_Z;
 
-    p->matArray = (depthMat_t *)malloc(sizeof(depthMat_t) * (p->maxDepth+1));
+    p->matArray = (depthMat_t *)bu_malloc(sizeof(depthMat_t) * 
(p->maxDepth+1), "alloc matArray");
 
     for (i = 0; i <= p->maxDepth; i++) {
        bu_strlcpy(p->matArray[i].name, DEFAULT_MAT, 
sizeof(p->matArray[i].name));


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to