diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2009-10-17 15:53:15 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2009-10-17 15:53:15 +0000 |
commit | e95ee133aa3630fbb79363f2c3664848ddf3bd43 (patch) | |
tree | 0d4bb1517cfd34f5c980bd960ae6b893e87d9f06 /bin | |
parent | 39410373b3d4a985f2263a688cebb667c5d55a5d (diff) | |
download | src-e95ee133aa3630fbb79363f2c3664848ddf3bd43.tar.gz src-e95ee133aa3630fbb79363f2c3664848ddf3bd43.zip |
Notes
Diffstat (limited to 'bin')
-rw-r--r-- | bin/csh/iconv_stub.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/csh/iconv_stub.c b/bin/csh/iconv_stub.c index 6bbbbb02a01a..d1a9e475d87e 100644 --- a/bin/csh/iconv_stub.c +++ b/bin/csh/iconv_stub.c @@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const char *fromcode) if (iconvlib == NULL) return (iconv_t)-1; iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN); + if (iconv_open == NULL) + goto dlfunc_err; dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE); + if (dl_iconv == NULL) + goto dlfunc_err; dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib, ICONV_CLOSE); + if (dl_iconv_close == NULL) + goto dlfunc_err; } return iconv_open(tocode, fromcode); + +dlfunc_err: + dlclose(iconvlib); + iconvlib = NULL; + return (iconv_t)-1; } |