$OpenBSD: patch-Source_cmIfCommand_cxx,v 1.6 2008/01/26 21:26:32 espie Exp $
--- Source/cmIfCommand.cxx.orig	Mon Jan 21 19:59:52 2008
+++ Source/cmIfCommand.cxx	Sat Jan 26 20:47:17 2008
@@ -220,8 +220,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string
   const char *def;
   const char *def2;
   const char* msg = "Unknown arguments specified";
-  *errorString = new char[strlen(msg) + 1];
-  strcpy(*errorString, msg);
+  *errorString = cmSystemTools::dupstring(msg);
 
   // handle empty invocation
   if (args.size() < 1)
@@ -390,8 +389,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string
           cmOStringStream error;
           error << "Regular expression \"" << rex << "\" cannot compile";
           delete [] *errorString;
-          *errorString = new char[error.str().size() + 1];
-          strcpy(*errorString, error.str().c_str());
+          *errorString = cmSystemTools::dupstring(error.str().c_str());
           return false;
           }
         if (regEntry.find(def))
