BUG/MEDIUM: arg: ensure that we properly unlink unresolved arguments on error
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Apr 2017 20:32:04 +0000 (22:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Apr 2017 10:20:52 +0000 (12:20 +0200)
commit0622f02b5aac4ae104f809a6beb836ccecef9a60
treedcdb6835e144e0d5abf2877a7a9c8bd6cd38b98f
parent266b1a8336bcb9a2d5de772a14b9d84af25bcf81
BUG/MEDIUM: arg: ensure that we properly unlink unresolved arguments on error

If make_arg_list() fails to process an argument after having queued an
unresolvable one, it frees the allocated argument list but doesn't remove
the referenced args from the arg list. This causes a use after free or a
double free if the same location was reused, during the deinit phase upon
exit after reporting the error.

Since it's not easy to properly unlinked all elements, we only release the
args block if none of them was queued in the list.
src/arg.c