Commits

Matt Knepley committed cd0a388 Merge

Merge branch 'jed/plex-Wmaybe-uninitialized'

* jed/plex-Wmaybe-uninitialized:
DMPlex: Need to protect this Free()

Comments (0)

Files changed (1)

src/snes/utils/dmplexsnes.c

   ierr = VecDestroy(&pointVec);CHKERRQ(ierr);
 #endif
   if ((void*)globalPointsScalar != (void*)globalPoints) {ierr = PetscFree(globalPointsScalar);CHKERRQ(ierr);}
-  ierr = PetscFree3(globalPoints,counts,displs);CHKERRQ(ierr);
+  if (!redundantPoints) {ierr = PetscFree3(globalPoints,counts,displs);CHKERRQ(ierr);}
   ierr = PetscLayoutDestroy(&layout);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }