Fix null deref in sdb_fmt