$OpenBSD: patch-Source_cmIfCommand_cxx,v 1.4 2007/03/20 11:23:10 espie Exp $
--- Source/cmIfCommand.cxx.orig	Wed Jan 10 18:59:13 2007
+++ Source/cmIfCommand.cxx	Sun Mar 18 13:52:02 2007
@@ -206,8 +206,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)
@@ -360,8 +359,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))
