]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add a check of a null pointer in order to eliminate what Clang complains.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 21 Mar 2011 20:39:16 +0000 (16:39 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 21 Mar 2011 20:39:16 +0000 (16:39 -0400)
Found with Clang Static Analyzer.

SVN-Revision: 3047

libarchive/archive_write_set_format_mtree.c

index d273c4152c867ab30efd2b8dc54865a888e3064a..44230bb19f3cb58181467496d31610c042371621 100644 (file)
@@ -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;