]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Remove an always-true condition from lzma_index_cat().
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 27 Jul 2018 13:02:58 +0000 (16:02 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 27 Jul 2018 13:02:58 +0000 (16:02 +0300)
This should help static analysis tools to see that newg
isn't leaked.

Thanks to Pavel Raiskup.

src/liblzma/common/index.c

index 26e4e519bc800627089297a73ae6df0d9921f901..007e1570424d84e0601e41d74ba7356bfad6a771 100644 (file)
@@ -825,8 +825,8 @@ lzma_index_cat(lzma_index *restrict dest, lzma_index *restrict src,
                                s->groups.root = &newg->node;
                        }
 
-                       if (s->groups.rightmost == &g->node)
-                               s->groups.rightmost = &newg->node;
+                       assert(s->groups.rightmost == &g->node);
+                       s->groups.rightmost = &newg->node;
 
                        lzma_free(g, allocator);