Date: Mon, 22 Jun 2009 21:49:56 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194663 - head/lib/libkiconv Message-ID: <200906222149.n5MLnuoI053824@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Mon Jun 22 21:49:55 2009 New Revision: 194663 URL: http://svn.freebsd.org/changeset/base/194663 Log: free(3) won't mess with errno so return it as-is. Submitted by: Jaakko Heinonen <jh saunalahti fi> Modified: head/lib/libkiconv/kiconv_sysctl.c Modified: head/lib/libkiconv/kiconv_sysctl.c ============================================================================== --- head/lib/libkiconv/kiconv_sysctl.c Mon Jun 22 21:46:40 2009 (r194662) +++ head/lib/libkiconv/kiconv_sysctl.c Mon Jun 22 21:49:55 2009 (r194663) @@ -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, cons { 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, cons 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 &&
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906222149.n5MLnuoI053824>