git.annexia.org
/
hivex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c94240f
)
Call iconv_close along error path out of function.
author
Hilko Bengen
<bengen@hilluzination.de>
Mon, 12 Jul 2010 13:50:31 +0000
(14:50 +0100)
committer
Richard Jones
<rjones@redhat.com>
Mon, 12 Jul 2010 13:51:22 +0000
(14:51 +0100)
lib/hivex.c
patch
|
blob
|
history
diff --git
a/lib/hivex.c
b/lib/hivex.c
index
c65f6de
..
2b22924
100644
(file)
--- a/
lib/hivex.c
+++ b/
lib/hivex.c
@@
-1275,12
+1275,16
@@
windows_utf16_to_utf8 (/* const */ char *input, size_t len)
size_t r = iconv (ic, &inp, &inlen, &outp, &outlen);
if (r == (size_t) -1) {
if (errno == E2BIG) {
+ int err = errno;
size_t prev = outalloc;
/* Try again with a larger output buffer. */
free (out);
outalloc *= 2;
- if (outalloc < prev)
+ if (outalloc < prev) {
+ iconv_close (ic);
+ errno = err;
return NULL;
+ }
goto again;
}
else {