Преглед изворни кода

set variable to NULL after freeing
(merge https://trac.osgeo.org/grass/changeset/41311 from relbr64)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41313 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa пре 15 година
родитељ
комит
81d58b7742

+ 1 - 0
gui/wxpython/nviz/init.cpp

@@ -150,6 +150,7 @@ void print_sentence (PyObject *pyFd, const int type, const char *msg)
 	
 	PyFile_WriteString(sentence, pyFd);
 	G_free((void *)sentence);
+	sentence = NULL;
 	
 	PyFile_WriteString("\n", pyFd);
 	start = next;

+ 1 - 0
gui/wxpython/nviz/surface.cpp

@@ -346,6 +346,7 @@ int Nviz::SetWireColor(int id, const char* color_str)
 	}
 
 	G_free(surf_list);
+	surf_list = NULL;
     }
 
     return 1;

+ 1 - 0
gui/wxpython/vdigit/driver_draw.cpp

@@ -150,6 +150,7 @@ int DisplayDriver::DrawMap(bool force)
 			isles[j] = NULL;
 		    }
 		    G_free((void *) isles);
+		    isles = NULL;
 		}
 	    }
 	}

+ 1 - 0
gui/wxpython/vdigit/line.cpp

@@ -860,6 +860,7 @@ int Digit::CopyLines(std::vector<int> ids, const char* bgmap_name)
     if (bgMap) {
 	Vect_close(bgMap);
 	G_free ((void *) bgMap);
+	bgMap = NULL;
     }
 
     return ret;