lda_controller: fix memory leak