riff: Fix potential memleak.