in_tail: validate memory allocation on tilde expansion
@@ -89,6 +89,10 @@ static char *expand_tilde(const char *path)
if (p) {
tmp = flb_malloc(PATH_MAX);
+ if (!tmp) {
+ flb_errno();
+ return NULL;
+ }
snprintf(tmp, PATH_MAX - 1, "%s%s", dir, p);
}
else {
