[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (b5818f0cb6f0647559b6265aaad8d4519670584e)



The branch, master has been updated
       via  b5818f0cb6f0647559b6265aaad8d4519670584e (commit)
       via  2293fb2f0fe5157661a486ddca79610813f92d9c (commit)
      from  b274cf8fe9c8caf5bcd4edc28935c88cf5bab7f4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/polygon1.c |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)


=================
 Commit Messages
=================

commit b5818f0cb6f0647559b6265aaad8d4519670584e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix leak of input objects for certain short-cut cases in poly_Boolean_free
    
    When either a or b input object is NULL, depending on the boolean operation
    selected, either a, b or NULL is returned as the result. Make sure we free
    any non NULL, and non-returned inputs when taking these shortcut paths.

:100644 100644 cc00888... c9a350f... M	src/polygon1.c

commit 2293fb2f0fe5157661a486ddca79610813f92d9c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix leak of cross vertex connectivity lists when deleting contours
    
    Free these lists as we free the contour's nodes in poly_DelContour()

:100644 100644 c0dd8e7... cc00888... M	src/polygon1.c

=========
 Changes
=========

commit b5818f0cb6f0647559b6265aaad8d4519670584e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix leak of input objects for certain short-cut cases in poly_Boolean_free
    
    When either a or b input object is NULL, depending on the boolean operation
    selected, either a, b or NULL is returned as the result. Make sure we free
    any non NULL, and non-returned inputs when taking these shortcut paths.

diff --git a/src/polygon1.c b/src/polygon1.c
index cc00888..c9a350f 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -1679,8 +1679,11 @@ poly_Boolean_free (POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
 	case PBO_XOR:
 	case PBO_UNITE:
 	  *res = bi;
+	  return err_ok;
 	case PBO_SUB:
 	case PBO_ISECT:
+	  if (b != NULL)
+	    poly_Free (&b);
 	  return err_ok;
 	}
     }
@@ -1692,7 +1695,10 @@ poly_Boolean_free (POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
 	case PBO_XOR:
 	case PBO_UNITE:
 	  *res = ai;
+	  return err_ok;
 	case PBO_ISECT:
+	  if (a != NULL)
+	    poly_Free (&a);
 	  return err_ok;
 	}
     }

commit 2293fb2f0fe5157661a486ddca79610813f92d9c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix leak of cross vertex connectivity lists when deleting contours
    
    Free these lists as we free the contour's nodes in poly_DelContour()

diff --git a/src/polygon1.c b/src/polygon1.c
index c0dd8e7..cc00888 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -1901,12 +1901,25 @@ poly_ClrContour (PLINE * c)
 void
 poly_DelContour (PLINE ** c)
 {
-  VNODE *cur;
+  VNODE *cur, *prev;
 
   if (*c == NULL)
     return;
-  for (cur = (*c)->head.prev; cur != &(*c)->head; free (cur->next))
-    cur = cur->prev;
+  for (cur = (*c)->head.prev; cur != &(*c)->head; cur = prev)
+    {
+      prev = cur->prev;
+      if (cur->cvc_next != NULL)
+        {
+          free (cur->cvc_next);
+          free (cur->cvc_prev);
+        }
+      free (cur);
+    }
+  if ((*c)->head.cvc_next != NULL)
+    {
+      free ((*c)->head.cvc_next);
+      free ((*c)->head.cvc_prev);
+    }
   /* FIXME -- strict aliasing violation.  */
   if ((*c)->tree)
     {




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs