From da16158c0a342aa0a0f9df286eff3091a9cb8083 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 16 Mar 2006 23:30:46 +0000 Subject: [project @ 2006-03-16 23:30:46 by dsilvers] Fix another assumption that freeing/dupping/whatever a NULL is safe. svn path=/import/netsurf/; revision=2132 --- utils/utf8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'utils/utf8.c') diff --git a/utils/utf8.c b/utils/utf8.c index 5425505ef..ea9f8c85f 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -298,7 +298,8 @@ utf8_convert_ret utf8_convert(const char *string, size_t len, } /* close the last cd - we don't care if this fails */ - iconv_close(last_cd.cd); + if (last_cd.cd) + iconv_close(last_cd.cd); /* and copy the to/from/cd data into last_cd */ strncpy(last_cd.from, from, 32); -- cgit v1.2.3