Skip to content

Commit

Permalink
Check to avoid calling iconv_close(-1) in openconnect_vpninfo_free
Browse files Browse the repository at this point in the history
Signed-off-by: Chad Catlett <chad@catlett.info>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
chadcatlett authored and David Woodhouse committed Aug 28, 2014
1 parent f1e4cf5 commit 74f08db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library.c
Expand Up @@ -156,8 +156,11 @@ void openconnect_vpninfo_free(struct openconnect_info *vpninfo)
}

#ifdef HAVE_ICONV
iconv_close(vpninfo->ic_utf8_to_legacy);
iconv_close(vpninfo->ic_legacy_to_utf8);
if (vpninfo->ic_utf8_to_legacy != (iconv_t)-1)
iconv_close(vpninfo->ic_utf8_to_legacy);

if (vpninfo->ic_legacy_to_utf8 != (iconv_t)-1)
iconv_close(vpninfo->ic_legacy_to_utf8);
#endif
#ifdef _WIN32
if (vpninfo->cmd_event)
Expand Down

0 comments on commit 74f08db

Please sign in to comment.