char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1];
memcpy(new_path,path,len + 1);
memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
+ free(const_cast<char *>(path));
return new_path;
}
namespace factor
{
-/* Snarfed from SBCL linux-so.c. You must delete[] the result yourself. */
+/* Snarfed from SBCL linux-so.c. You must free() the result yourself. */
const char *vm_executable_path()
{
char *path = new char[PATH_MAX + 1];
else
{
path[size] = '\0';
- return safe_strdup(path);
+
+ const char *ret = safe_strdup(path);
+ delete[] path;
+ return ret;
}
}