aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'format.c')
-rw-r--r--format.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/format.c b/format.c
index bb324d56..96c7efb3 100644
--- a/format.c
+++ b/format.c
@@ -1102,8 +1102,10 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
found = xstrdup("");
}
}
- if (format_choose(ptr + 1, &left, &right) != 0)
+ if (format_choose(ptr + 1, &left, &right) != 0) {
+ free(found);
goto fail;
+ }
if (format_true(found))
value = format_expand(ft, left);