filter: Fix additional buffer overflows
coverity: filter: Fix resource leak