Revision: 48510
          http://brlcad.svn.sourceforge.net/brlcad/?rev=48510&view=rev
Author:   n_reed
Date:     2012-01-12 16:01:36 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
prevent leak, remove dead free, CID 165

Modified Paths:
--------------
    brlcad/trunk/src/conv/comgeom/solid.c

Modified: brlcad/trunk/src/conv/comgeom/solid.c
===================================================================
--- brlcad/trunk/src/conv/comgeom/solid.c       2012-01-12 15:58:51 UTC (rev 
48509)
+++ brlcad/trunk/src/conv/comgeom/solid.c       2012-01-12 16:01:36 UTC (rev 
48510)
@@ -774,8 +774,11 @@
        /* Obtain vertex input_points */
        input_points = (double *)bu_malloc(npt*3*sizeof(double), 
"input_points");
 
-       if ( getxsoldata( input_points, npt*3, sol_work ) < 0 )
+       if ( getxsoldata( input_points, npt*3, sol_work ) < 0 ) {
+           bu_free( (char *)input_points, "input_points" );
+           input_points = (double *)0;
            goto bad;
+       }
     }
 
     /* Get planes defined by three points, 6 per card */
@@ -923,7 +926,6 @@
     bu_free( (char *)input_points, "input_points" );
     input_points = (double *)0;
 
-
     /*
      *  ARBN must be convex.  Test for concavity.
      *  Byproduct is an enumeration of all the verticies.
@@ -1003,7 +1005,6 @@
     /* Write out the solid ! */
     i = mk_arbn( outfp, name, nface, eqn );
 
-    if ( input_points )  bu_free( (char *)input_points, "input_points" );
     if ( vertex )  bu_free( (char *)vertex, "vertex" );
     if ( eqn )  bu_free( (char *)eqn, "eqn" );
     if ( used )  bu_free( (char *)used, "used" );

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


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to