[Acc] [PATCH 4/4] uadk: fix memory safety, resource leaks and uninit issues