diff --git a/Configure.hxx.in b/Configure.hxx.in
index 444f46f310b793f71353ac73278fb3b8c41856e9..1536e727b0343a4794a4dadc699ed5be89f78dd0 100644
--- a/Configure.hxx.in
+++ b/Configure.hxx.in
@@ -17,6 +17,9 @@
 /* Include C configuration.  */
 #include <@KWSYS_NAMESPACE@/Configure.h>
 
+/* Disable cleanup of putenv memory for issues with GCOV */
+#cmakedefine KWSYS_DO_NOT_CLEAN_PUTENV
+
 /* Whether ANSI C++ stream headers are to be used.  */
 #define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@
 
diff --git a/SystemTools.cxx b/SystemTools.cxx
index dc9977c8cdff5124b70ea145c357f7570d4dcb15..16683a9f0565c53da6f171ac41e8bb7df0dba27b 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -415,11 +415,13 @@ public:
 
 kwsysDeletingCharVector::~kwsysDeletingCharVector()
 {
+#ifndef KWSYS_DO_NOT_CLEAN_PUTENV
   for(kwsys_stl::vector<char*>::iterator i = this->begin();
       i != this->end(); ++i)
     {
     delete []*i;
     }
+#endif
 }
 bool SystemTools::PutEnv(const char* value)
 {