diff options
author | delphij <delphij@FreeBSD.org> | 2009-06-22 21:49:55 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-06-22 21:49:55 +0000 |
commit | d6cefb87bbc562d238c4d1256b2249d8e03a84fc (patch) | |
tree | cd832bf7d0bb055f15d24d826e58990835ae1805 /lib/libkiconv | |
parent | 00948f56d32c33988293fc924f042b151169e1d3 (diff) | |
download | FreeBSD-src-d6cefb87bbc562d238c4d1256b2249d8e03a84fc.zip FreeBSD-src-d6cefb87bbc562d238c4d1256b2249d8e03a84fc.tar.gz |
free(3) won't mess with errno so return it as-is.
Submitted by: Jaakko Heinonen <jh saunalahti fi>
Diffstat (limited to 'lib/libkiconv')
-rw-r--r-- | lib/libkiconv/kiconv_sysctl.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c index 0030f4d..7eebf2b 100644 --- a/lib/libkiconv/kiconv_sysctl.c +++ b/lib/libkiconv/kiconv_sysctl.c @@ -39,7 +39,6 @@ int kiconv_lookupconv(const char *drvname) { size_t size; - int error; if (sysctlbyname("kern.iconv.drvlist", NULL, &size, NULL, 0) == -1) return (errno); @@ -50,7 +49,6 @@ kiconv_lookupconv(const char *drvname) if (drivers == NULL) return (ENOMEM); if (sysctlbyname("kern.iconv.drvlist", drivers, &size, NULL, 0) == -1) { - error = errno; free(drivers); return (errno); } @@ -68,7 +66,6 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) { size_t i, size; struct iconv_cspair_info *csi, *csip; - int error; if (sysctlbyname("kern.iconv.cslist", NULL, &size, NULL, 0) == -1) return (errno); @@ -77,9 +74,8 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) if (csi == NULL) return (ENOMEM); if (sysctlbyname("kern.iconv.cslist", csi, &size, NULL, 0) == -1) { - error = errno; free(csi); - return (error); + return (errno); } for (i = 0, csip = csi; i < (size/sizeof(*csi)); i++, csip++){ if (strcmp(csip->cs_to, tocode) == 0 && |