[MOAB-dev] r4661 - MOAB/trunk/itaps/imesh

jvporter at wisc.edu jvporter at wisc.edu
Sat Mar 26 16:06:03 CDT 2011


Author: jvporter
Date: 2011-03-26 16:06:01 -0500 (Sat, 26 Mar 2011)
New Revision: 4661

Modified:
   MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp
Log:
Check allocated space before pointer value in array manager, since that's more
likely to be initialized (fixes a bunch of valgrind warnings in the nightly
iMesh tests)


Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp	2011-03-25 22:36:51 UTC (rev 4660)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp	2011-03-26 21:06:01 UTC (rev 4661)
@@ -132,7 +132,7 @@
                      int val_size,
                      int* err ) : arrayPtr(0)
   {
-    if (!*array_ptr || !array_allocated_space) {
+    if (!array_allocated_space || !*array_ptr) {
       *array_ptr = std::malloc(val_size * count);
       array_allocated_space = array_size = count;
       if (!*array_ptr) {








































More information about the moab-dev mailing list