[GRASS-SVN] r46967 -
grass/branches/releasebranch_6_4/vector/v.generalize
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 4 07:07:18 EDT 2011
Author: mmetz
Date: 2011-07-04 04:07:18 -0700 (Mon, 04 Jul 2011)
New Revision: 46967
Modified:
grass/branches/releasebranch_6_4/vector/v.generalize/misc.c
Log:
fix memory leak
Modified: grass/branches/releasebranch_6_4/vector/v.generalize/misc.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.generalize/misc.c 2011-07-04 11:06:27 UTC (rev 46966)
+++ grass/branches/releasebranch_6_4/vector/v.generalize/misc.c 2011-07-04 11:07:18 UTC (rev 46967)
@@ -286,6 +286,7 @@
/* Vect_line_intersection is quite slow, hopefully not so bad because only few
* intersections should be found if any */
+ AXLines = BXLines = NULL;
Vect_line_intersection(Points, BPoints, &AXLines, &BXLines,
&naxlines, &nbxlines, 0);
@@ -298,14 +299,16 @@
for (j = 0; j < naxlines; j++) {
Vect_destroy_line_struct(AXLines[j]);
}
+ }
+ if (AXLines)
G_free(AXLines);
- }
if (nbxlines > 0) {
for (j = 0; j < nbxlines; j++) {
Vect_destroy_line_struct(BXLines[j]);
}
+ }
+ if (BXLines)
G_free(BXLines);
- }
if (naxlines > 1 || nbxlines > 1) {
intersect = 1;
More information about the grass-commit
mailing list