]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix a part of a commit 221f63f2f8.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 18 Sep 2012 07:39:42 +0000 (16:39 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 18 Sep 2012 07:39:42 +0000 (16:39 +0900)
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.

libarchive/archive_string.c

index d75966f3f4bf2c59cb6d8673beabc3fb4ecdc2b3..92f9404d453925e9c44fe45fe819e86524e0ef07 100644 (file)
@@ -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. */