[brlcad-commits] SF.net SVN: brlcad:[49415] brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2012-02-14 16:17:35
|
Revision: 49415 http://brlcad.svn.sourceforge.net/brlcad/?rev=49415&view=rev Author: brlcad Date: 2012-02-14 16:17:23 +0000 (Tue, 14 Feb 2012) Log Message: ----------- remove the loopuse pointers from the loops table prior to killing them so we're not passing around free'd pointers to functions. it's fine for bu_ptbl since it references them by value, but smells funny and could be misleading down the road. (USE_AFTER_FREE false positive, cov cid 2101) Modified Paths: -------------- brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c 2012-02-14 16:05:44 UTC (rev 49414) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c 2012-02-14 16:17:23 UTC (rev 49415) @@ -491,6 +491,12 @@ if (fu1 == fu2) continue; + /* remove from loops prior to kill so we don't pass around + * free'd pointers. fine for ptbl, but misleading. + */ + bu_ptbl_rm(&loops, lu1); + bu_ptbl_rm(&loops, lu2); + if (nmg_klu(lu1)) { if (nmg_kfu(fu1)) goto out; @@ -500,8 +506,6 @@ goto out; } - bu_ptbl_rm(&loops, (long *)lu1); - bu_ptbl_rm(&loops, (long *)lu2); i--; break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |