Revision: 56756
http://sourceforge.net/p/brlcad/code/56756
Author: brlcad
Date: 2013-08-12 19:29:18 +0000 (Mon, 12 Aug 2013)
Log Message:
-----------
pair bu_malloc()+bu_free() but make sure it's not a null pointer just in case
the book-keeping is pooched (which it is).
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/bot/tie.c
Modified: brlcad/trunk/src/librt/primitives/bot/tie.c
===================================================================
--- brlcad/trunk/src/librt/primitives/bot/tie.c 2013-08-12 19:22:40 UTC (rev
56755)
+++ brlcad/trunk/src/librt/primitives/bot/tie.c 2013-08-12 19:29:18 UTC (rev
56756)
@@ -153,8 +153,10 @@
unsigned int i;
/* Free Triangle Data */
- for (i = 0; i < tie->tri_num; i++)
- bu_free((void *)((intptr_t)(tie->tri_list[i].v) & ~0x7L), "tie_free");
+ for (i = 0; i < tie->tri_num; i++) {
+ tfloat *ptr = (tfloat *)((intptr_t)(tie->tri_list[i].v) & ~0x7L);
+ bu_free(ptr, "free tfloat list");
+ }
bu_free(tie->tri_list, "tie_free");
/* Free KDTREE Nodes */
@@ -453,8 +455,8 @@
plist = (void *)((intptr_t)plist + pstride);
/* ??? this looks like it might cause fragmentation? use a memory pool?
*/
- tie->tri_list[tie->tri_num].v = (tfloat *)malloc(2*sizeof(tfloat));
- if(tie->tri_list[tie->tri_num].v == NULL)
+ tie->tri_list[tie->tri_num].v = (tfloat *)bu_malloc(2*sizeof(tfloat),
"alloc tfloat list");
+ if (tie->tri_list[tie->tri_num].v == NULL)
bu_log("Bad malloc! %s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);
tie->tri_num++;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits