File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -592,27 +592,34 @@ int CFCheck_Validate(const char *path)
592
592
rc = mdb_env_open (env , path , MDB_NOSUBDIR | MDB_RDONLY , 0644 );
593
593
if (rc != 0 )
594
594
{
595
+ mdb_env_close (env );
595
596
return rc ;
596
597
}
597
598
598
599
MDB_txn * txn ;
599
600
rc = mdb_txn_begin (env , NULL , MDB_RDONLY , & txn );
600
601
if (rc != 0 )
601
602
{
603
+ mdb_env_close (env );
602
604
return rc ;
603
605
}
604
606
605
607
MDB_dbi dbi ;
606
608
rc = mdb_open (txn , NULL , 0 , & dbi );
607
609
if (rc != 0 )
608
610
{
611
+ mdb_txn_abort (txn );
612
+ mdb_env_close (env );
609
613
return rc ;
610
614
}
611
615
612
616
MDB_cursor * cursor ;
613
617
rc = mdb_cursor_open (txn , dbi , & cursor );
614
618
if (rc != 0 )
615
619
{
620
+ mdb_close (env , dbi );
621
+ mdb_txn_abort (txn );
622
+ mdb_env_close (env );
616
623
return rc ;
617
624
}
618
625
@@ -627,6 +634,10 @@ int CFCheck_Validate(const char *path)
627
634
{
628
635
// At this point, not found is expected, anything else is an error
629
636
DestroyValidator (& state );
637
+ mdb_cursor_close (cursor );
638
+ mdb_close (env , dbi );
639
+ mdb_txn_abort (txn );
640
+ mdb_env_close (env );
630
641
return rc ;
631
642
}
632
643
mdb_cursor_close (cursor );
You can’t perform that action at this time.
0 commit comments