diff --git a/ispc.cpp b/ispc.cpp index 73fe446a..65dc0b67 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -75,7 +75,7 @@ Target::GetTarget(const char *arch, const char *cpu, const char *isa, if (cpu == NULL) { std::string hostCPU = llvm::sys::getHostCPUName(); if (hostCPU.size() > 0) - cpu = hostCPU.c_str(); + cpu = strdup(hostCPU.c_str()); else { fprintf(stderr, "Warning: unable to determine host CPU!\n"); cpu = "generic";