Skip to content

Commit

Permalink
add test for reported debian segfault for double free
Browse files Browse the repository at this point in the history
  • Loading branch information
toddr committed Jul 19, 2010
1 parent 5aeb663 commit 1d17a36
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions t/bug/rt-49404-double_free.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!perl -T

use strict;
use warnings;

use Test::More tests => 4;

use YAML::Syck;

my $entry = { a => 'b' };
my $db = [$entry, $entry];

my $dump = Dump ( $db );
is($dump, qq{--- \n- &1 \n a: b\n- *1\n});

my $dbcopy = Load ( $dump );
is_deeply($dbcopy, $db);

$dbcopy->[1] = $dbcopy->[0];
my $dumpcopy = Dump ( $dbcopy );
is($dump, qq{--- \n- &1 \n a: b\n- *1\n});

my $dbcopycopy = Load ( $dumpcopy );
is_deeply($dbcopy, $db);



0 comments on commit 1d17a36

Please sign in to comment.