Fix CID 1491069 and 1491256: resource leaks.