BUG/MINOR: log: free errmsg on error in cfg_parse_log_forward()

When leaving cfg_parse_log_forward() on error paths, errmsg which is local
to the function could still point to valid data, and it's our
responsibility to free it.

Instead of freeing it everywhere it is invoved, we free it prior to
leaving the function.

This should be backported as far as 2.4.
This commit is contained in:
Aurelien DARRAGON 2023-07-04 15:36:45 +02:00 committed by Christopher Faulet
parent 21cf42f579
commit 9f9d557468

View File

@ -3962,6 +3962,7 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm)
goto out;
}
out:
ha_free(&errmsg);
return err_code;
}