diff options
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16.h')
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16.h b/llvm/lib/Target/PIC16/PIC16.h index e46c9b242e3..8d067de676b 100644 --- a/llvm/lib/Target/PIC16/PIC16.h +++ b/llvm/lib/Target/PIC16/PIC16.h @@ -55,9 +55,10 @@ namespace PIC16CC { // External symbol names require memory to live till the program end. // So we have to allocate it and keep. + // FIXME: Don't leak the allocated strings. inline static const char *createESName (const std::string &name) { char *tmpName = new char[name.size() + 1]; - strcpy (tmpName, name.c_str()); + memcpy(tmpName, name.c_str(), name.size() + 1); return tmpName; } |

