buaazp: fixed memory leak in local and db mode which make me crazy!