master: Fix bug found by Valgrind in metadata dumper

Change-Id: I9e57bb808482a3269ff3778b1e309ff67f9577d0