@ -34,6 +34,8 @@ void TR_free(void **);
size_t TR_getSize(void *);
void TR_cleanup();
char * TR_strdup(const char *);
#endif // __TR_MEMORY_H__
// vim: set ts=4 sw=4:
@ -505,4 +505,19 @@ TR_cleanup()
#endif
}
char *
TR_strdup(const char * src)
{
char * dup;
if (NULL == src) {
return NULL;
dup = TR_malloc(strlen(src)+1);
strcpy(dup, src);
return dup;