canonicalise_opt must always return heap memory.

Thanks to Max Julian Hofmann for spotting this.
This commit is contained in:
Simon Kelley
2021-07-20 23:22:37 +01:00
parent f0dc324e35
commit 32e15c3f45

View File

@@ -654,7 +654,7 @@ static char *canonicalise_opt(char *s)
return 0;
if (strlen(s) == 0)
return "";
return opt_string_alloc("");
unhide_metas(s);
if (!(ret = canonicalise(s, &nomem)) && nomem)