smyrna clear_selpoly: simplify some 'free' code
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:01:04 +0000 (18:01 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:06:29 +0000 (18:06 -0700)
cmd/smyrna/selectionfuncs.c

index b96d8b54f016ee0578c0c43206a6e9db11097f82..184b44d013f081d9e3e1f2ee9622f4a5a1126120 100644 (file)
@@ -235,7 +235,8 @@ void deselect_all(Agraph_t* g)
 
 void clear_selpoly(glCompPoly* sp)
 {
-    sp->pts=realloc(sp->pts,0);
+    free(sp->pts);
+    sp->pts = NULL;
     sp->cnt=0;
 }
 static int close_poly(glCompPoly* selPoly,glCompPoint pt)