Fix CID 1491162, 1491183, 1491321 and 1491257: resource leaks.