From: Michihiro NAKAJIMA Date: Mon, 21 Mar 2011 20:39:16 +0000 (-0400) Subject: Add a check of a null pointer in order to eliminate what Clang complains. X-Git-Tag: v3.0.0a~625 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49b77aca9a1220e412d46f574d6e01df643b2bd1;p=thirdparty%2Flibarchive.git Add a check of a null pointer in order to eliminate what Clang complains. Found with Clang Static Analyzer. SVN-Revision: 3047 --- diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c index d273c4152..44230bb19 100644 --- a/libarchive/archive_write_set_format_mtree.c +++ b/libarchive/archive_write_set_format_mtree.c @@ -638,7 +638,8 @@ inc_attr_count(struct attr_counter **top, struct attr_counter *ac, ac->prev = pac; ac->next = pac->next; pac->next = ac; - ac->next->prev = ac; + if (ac->next != NULL) + ac->next->prev = ac; } else { ac->prev = NULL; ac->next = *top;