diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2012-01-23 04:08:46 -0500 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2012-01-23 04:08:46 -0500 |
commit | b37f787130c8084ff147419224bfe76c128ef0c2 (patch) | |
tree | 0e32af8d9b5b74382a700d93c7a7293ef1805479 /libarchive/archive_util.c | |
parent | 8f230c6c30a4e9bc93454f4a5b4b4cf0e3597c31 (diff) | |
download | libarchive-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.c | 5 |
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'/'); } |