From: Michihiro NAKAJIMA Date: Tue, 18 Sep 2012 07:39:42 +0000 (+0900) Subject: Fix a part of a commit 221f63f2f8. X-Git-Tag: v3.1.0~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52ca91f512995676c9f811583751d0bd48cbef43;p=thirdparty%2Flibarchive.git 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. --- diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index d75966f3f..92f9404d4 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. */