]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Clean up gpst parse_login_xml() a little
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 15 Aug 2017 13:50:55 +0000 (14:50 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 15 Aug 2017 13:54:41 +0000 (14:54 +0100)
commit72417537432653cb8f7821ca3e1dfeb8a570b3c4
treee222767c18b3f309b797ae88024d41e7ceeb8202
parent23aa3de22d383345a1e92d45454895fc7d3f34d2
Clean up gpst parse_login_xml() a little

Fix a potential double-free when we hit a non-"argument" node, which could
cause a 'goto err_out' with value still set to the one that was already
freed last time round the loop.

Cosmetic changes to the args array, and change the loop over them. The
'continue' on !arg->opt doesn't seem to be useful; let's use !arg->opt
as the condition to terminate the loop instead.

Most 'const' removal, although actually I think it probably *can* be
const if we just use xml_node->content directly, and that means we don't
need to free it at all. Didn't want to make that change without testing
it though.

Steal cookie->data instead of strdup() and then immediately freeing it,
like we do for Juniper.

Other trivial cosmetic changes (spaces, !x instead of x==NULL or even
X == NULL).

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
auth-globalprotect.c