summaryrefslogtreecommitdiff
path: root/libarchive/archive_util.c
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-01-23 04:08:46 -0500
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-01-23 04:08:46 -0500
commitb37f787130c8084ff147419224bfe76c128ef0c2 (patch)
tree0e32af8d9b5b74382a700d93c7a7293ef1805479 /libarchive/archive_util.c
parent8f230c6c30a4e9bc93454f4a5b4b4cf0e3597c31 (diff)
downloadlibarchive-b37f787130c8084ff147419224bfe76c128ef0c2.tar.gz
When ENOMEM happened in archive_string_append_from_wcs and archive_string_append_from_mbs,
those function should report the error to the caller instead of invoking __archive_errx(). We should report that ENOMEM error as possible as we can and we still need to further improve reporting ENOEM. SVN-Revision: 4193
Diffstat (limited to 'libarchive/archive_util.c')
-rw-r--r--libarchive/archive_util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
index e0852a3b..103c009d 100644
--- a/libarchive/archive_util.c
+++ b/libarchive/archive_util.c
@@ -243,8 +243,9 @@ __archive_mktemp(const char *tmpdir)
archive_wstrcpy(&temp_name, tmp);
free(tmp);
} else {
- archive_wstring_append_from_mbs(&temp_name, tmpdir,
- strlen(tmpdir));
+ if (archive_wstring_append_from_mbs(&temp_name, tmpdir,
+ strlen(tmpdir)) < 0)
+ goto exit_tmpfile;
if (temp_name.s[temp_name.length-1] != L'/')
archive_wstrappend_wchar(&temp_name, L'/');
}