s4:lib/util/charset/iconv.c - remove a distinction which can never happen
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 20 Oct 2010 17:55:28 +0000 (19:55 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 21 Oct 2010 06:28:50 +0000 (08:28 +0200)
"ret->cd_direct" is never set before. It is set in the "if" upperwards but
then the function is terminated with "return".

lib/util/charset/iconv.c

index 2dac333d0c4beed9b199f212fe50c788c41ce385..66a81800616e1241f1573eea9e26cc1532bcc212 100644 (file)
@@ -159,7 +159,7 @@ static bool is_utf16(const char *name)
 }
 
 int smb_iconv_t_destructor(smb_iconv_t hwd)
-{ 
+{
 #ifdef HAVE_NATIVE_ICONV
        if (hwd->cd_pull != NULL && hwd->cd_pull != (iconv_t)-1)
                iconv_close(hwd->cd_pull);
@@ -260,9 +260,6 @@ _PUBLIC_ smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
        }
        if (is_utf16(tocode)) {
                ret->direct = sys_iconv;
-               /* could be set just above - so we need to close iconv */
-               if (ret->cd_direct != NULL && ret->cd_direct != (iconv_t)-1)
-                       iconv_close(ret->cd_direct);
                ret->cd_direct = ret->cd_pull;
                ret->cd_pull = NULL;
                return ret;