diff --git a/format.c b/format.c index 7ff11b59..0d7d7c20 100644 --- a/format.c +++ b/format.c @@ -643,6 +643,8 @@ format_find(struct format_tree *ft, const char *key, int modifiers) return (NULL); found: + if (found == NULL) + return (NULL); copy = xstrdup(found); if (modifiers & FORMAT_BASENAME) { saved = copy;