fix memory leak introduced with r9516