fix memory issue detected by clang static analyzer