--- sourceforge.net/trunk/rdesktop/rdesktop.c 2005/08/04 12:44:10 973 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2005/08/04 12:50:15 974 @@ -382,12 +382,7 @@ locale = setlocale(LC_ALL, ""); if (locale) { - locale = strdup(locale); - if (locale == NULL) - { - perror("strdup"); - exit(1); - } + locale = xstrdup(locale); } #endif @@ -939,6 +934,19 @@ exit(1); } return mem; +} + +/* strdup */ +char * +xstrdup(const char *s) +{ + char *mem = strdup(s); + if (mem == NULL) + { + perror("strdup"); + exit(1); + } + return mem; } /* realloc; exit if out of memory */