summaryrefslogtreecommitdiff
path: root/libarchive/archive_string.c
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-09-18 16:39:42 +0900
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-09-18 16:39:42 +0900
commit52ca91f512995676c9f811583751d0bd48cbef43 (patch)
tree4a00439fafda4d65d980ad31e0da4ca8685117be /libarchive/archive_string.c
parente5f6f42a7e0ca453332368337437ad996124fd3e (diff)
downloadlibarchive-52ca91f512995676c9f811583751d0bd48cbef43.tar.gz
Fix a part of a commit 221f63f2f8.
The double free bug Clang Static Anlyzer(trunk) claimed of was the Clang's bug, which is currently fixed, and it made a memory leak.
Diffstat (limited to 'libarchive/archive_string.c')
-rw-r--r--libarchive/archive_string.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
index d75966f3..92f9404d 100644
--- a/libarchive/archive_string.c
+++ b/libarchive/archive_string.c
@@ -306,9 +306,6 @@ archive_string_ensure(struct archive_string *as, size_t s)
/* Now we can reallocate the buffer. */
p = (char *)realloc(as->s, new_length);
if (p == NULL) {
- /* Prevent the duble free of as->s in archive_string_free
- * since realloc function already freed the memory. */
- as->s = NULL;
/* On failure, wipe the string and return NULL. */
archive_string_free(as);
errno = ENOMEM;/* Make sure errno has ENOMEM. */