]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix the error which Clang Static Analyzer says "Assigned value is garbage or undefine...
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 27 Feb 2012 08:52:31 +0000 (17:52 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 27 Feb 2012 08:52:31 +0000 (17:52 +0900)
libarchive/archive_read_support_format_iso9660.c

index 7dd31ab8adf48f896503e7e49da1244dcd38f00a..d38c7cfe7e42e162fe41b0b4001f4a95c57a929e 100644 (file)
@@ -2277,7 +2277,7 @@ register_CE(struct archive_read *a, int32_t location,
                        archive_set_error(&a->archive, ENOMEM, "Out of memory");
                        return (ARCHIVE_FATAL);
                }
-               p = malloc(new_size * sizeof(p[0]));
+               p = calloc(new_size, sizeof(p[0]));
                if (p == NULL) {
                        archive_set_error(&a->archive, ENOMEM, "Out of memory");
                        return (ARCHIVE_FATAL);