diff --git a/src/sacctmgr/user_functions.c b/src/sacctmgr/user_functions.c
index b455ce73332515a79ab9ef875604887df8ae3fb0..d8fad55a894cfcf1da2f8fda8e667419f4253e24 100644
--- a/src/sacctmgr/user_functions.c
+++ b/src/sacctmgr/user_functions.c
@@ -1218,7 +1218,8 @@ no_default:
 	list_destroy(local_user_list);
 	list_destroy(local_acct_list);
 	list_destroy(local_assoc_list);
-	list_destroy(local_wckey_list);
+	if(local_wckey_list)
+		list_destroy(local_wckey_list);
 	destroy_acct_wckey_cond(wckey_cond);
 	destroy_acct_association_cond(assoc_cond);