CID-1256273/CID-1256274/CID-1256275 leaky resources plus switch
statement warning

reviewed by Wilder Rodrigues