diff --git a/src/plugins/accounting_storage/mysql/as_mysql_acct.c b/src/plugins/accounting_storage/mysql/as_mysql_acct.c
index e90b8965fe126f373e4cc63b013ebca78799c355..6d188e742dc2c2f88515cecf15731cda9b688257 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_acct.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_acct.c
@@ -667,7 +667,7 @@ empty:
 
 	acct_list = list_create(slurmdb_destroy_account_rec);
 
-	if (acct_cond && acct_cond->with_assocs) {
+	if (acct_cond && acct_cond->with_assocs && acct_cond->assoc_cond) {
 		/* We are going to be freeing the inners of
 		   this list in the acct->name so we don't
 		   free it here