@@ -6762,6 +6762,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
6762
6762
{
6763
6763
int error = 0 ;
6764
6764
char * poolname , * bogus_name = NULL ;
6765
+ boolean_t freecfg = B_FALSE ;
6765
6766
6766
6767
/* If the target is not a pool, the extract the pool name */
6767
6768
char * path_start = strchr (target , '/' );
@@ -6780,6 +6781,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
6780
6781
"spa_get_stats() failed with error %d\n" ,
6781
6782
poolname , error );
6782
6783
}
6784
+ freecfg = B_TRUE ;
6783
6785
}
6784
6786
6785
6787
if (asprintf (& bogus_name , "%s%s" , poolname , BOGUS_SUFFIX ) == -1 )
@@ -6789,6 +6791,8 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
6789
6791
error = spa_import (bogus_name , cfg , NULL ,
6790
6792
ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT |
6791
6793
ZFS_IMPORT_SKIP_MMP );
6794
+ if (freecfg )
6795
+ nvlist_free (cfg );
6792
6796
if (error != 0 ) {
6793
6797
fatal ("Tried to import pool \"%s\" but spa_import() failed "
6794
6798
"with error %d\n" , bogus_name , error );
@@ -7017,15 +7021,14 @@ verify_checkpoint_blocks(spa_t *spa)
7017
7021
7018
7022
spa_t * checkpoint_spa ;
7019
7023
char * checkpoint_pool ;
7020
- nvlist_t * config = NULL ;
7021
7024
int error = 0 ;
7022
7025
7023
7026
/*
7024
7027
* We import the checkpointed state of the pool (under a different
7025
7028
* name) so we can do verification on it against the current state
7026
7029
* of the pool.
7027
7030
*/
7028
- checkpoint_pool = import_checkpointed_state (spa -> spa_name , config ,
7031
+ checkpoint_pool = import_checkpointed_state (spa -> spa_name , NULL ,
7029
7032
NULL );
7030
7033
ASSERT (strcmp (spa -> spa_name , checkpoint_pool ) != 0 );
7031
7034
0 commit comments