From 312b87268daa3aaec605f03377891824c422ee1f Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Sat, 2 Oct 2004 19:24:26 +0000 Subject: [PATCH] Revert, don't use strdup. --- lib/toutf8.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/toutf8.c b/lib/toutf8.c index ccde705..a5d5f95 100644 --- a/lib/toutf8.c +++ b/lib/toutf8.c @@ -113,7 +113,13 @@ stringprep_convert (const char *str, int have_error = 0; if (strcmp (to_codeset, from_codeset) == 0) - return strdup (str); + { + char *q; + q = malloc (strlen (str) + 1); + if (!q) + return NULL; + return strcpy (q, str); + } cd = iconv_open (to_codeset, from_codeset); -- 2.11.4.GIT