This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Storable: Own ASSERT or no, we want to assert(prev).
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 4 Feb 2016 00:40:21 +0000 (19:40 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 7 Feb 2016 13:23:46 +0000 (08:23 -0500)
Coverity CID 135012: Explicit null dereferenced (FORWARD_NULL)

The prev can be set to NULL (zero) just few lines earlier.

dist/Storable/Storable.xs

index f1386d3..83cd001 100644 (file)
@@ -1667,6 +1667,7 @@ static void free_context(pTHX_ stcxt_t *cxt)
 
        ASSERT(!cxt->s_dirty, ("clean context"));
        ASSERT(prev, ("not freeing root context"));
+       assert(prev);
 
        SvREFCNT_dec(cxt->my_sv);
        SET_STCXT(prev);