summaryrefslogtreecommitdiff
path: root/lib/striconveh.c
diff options
context:
space:
mode:
authorDaniel Llorens <lloda@sarc.name>2021-04-08 20:54:42 +0200
committerDaniel Llorens <lloda@sarc.name>2021-04-08 21:00:42 +0200
commitbdb07f8fc7b37ef64498c7b06cd4457faf456189 (patch)
tree4c98d2d714f2071513897efe01063bebc36e32cb /lib/striconveh.c
parent88e703084567eb99238a3be6ba4285d87a25eeae (diff)
downloadguile-wip-gnulib-update.tar.gz
Update gnulib to a3a946f670718d0dee5a7425ad5ac0a29fb46ea1wip-gnulib-update
This fixes https://lists.gnu.org/archive/html/guile-devel/2021-04/msg00009.html
Diffstat (limited to 'lib/striconveh.c')
-rw-r--r--lib/striconveh.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/lib/striconveh.c b/lib/striconveh.c
index d24d2d362..82f6467ba 100644
--- a/lib/striconveh.c
+++ b/lib/striconveh.c
@@ -499,11 +499,7 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
else
{
if (result != initial_result)
- {
- int saved_errno = errno;
- free (result);
- errno = saved_errno;
- }
+ free (result);
return -1;
}
}
@@ -570,11 +566,7 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
else
{
if (result != initial_result)
- {
- int saved_errno = errno;
- free (result);
- errno = saved_errno;
- }
+ free (result);
return -1;
}
}
@@ -683,11 +675,7 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
&& !(errno == E2BIG || errno == EINVAL || errno == EILSEQ))
{
if (result != initial_result)
- {
- int saved_errno = errno;
- free (result);
- errno = saved_errno;
- }
+ free (result);
return -1;
}
if (res1 == (size_t)(-1)
@@ -907,22 +895,14 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
{
/* Failure converting the ASCII replacement. */
if (result != initial_result)
- {
- int saved_errno = errno;
- free (result);
- errno = saved_errno;
- }
+ free (result);
return -1;
}
}
else
{
if (result != initial_result)
- {
- int saved_errno = errno;
- free (result);
- errno = saved_errno;
- }
+ free (result);
return -1;
}
}
@@ -1041,12 +1021,7 @@ str_cd_iconveh (const char *src,
if (retval < 0)
{
- if (result != NULL)
- {
- int saved_errno = errno;
- free (result);
- errno = saved_errno;
- }
+ free (result);
return NULL;
}
@@ -1118,12 +1093,8 @@ mem_iconveh (const char *src, size_t srclen,
{
if (iconveh_close (&cd) < 0)
{
- /* Return -1, but free the allocated memory, and while doing
- that, preserve the errno from iconveh_close. */
- int saved_errno = errno;
- if (result != *resultp && result != NULL)
+ if (result != *resultp)
free (result);
- errno = saved_errno;
return -1;
}
*resultp = result;
@@ -1177,11 +1148,7 @@ str_iconveh (const char *src,
{
if (iconveh_close (&cd) < 0)
{
- /* Return NULL, but free the allocated memory, and while doing
- that, preserve the errno from iconveh_close. */
- int saved_errno = errno;
free (result);
- errno = saved_errno;
return NULL;
}
}