]> git.ipfire.org Git - thirdparty/freeradius-server.git/commit
Fix userparse function
authorAlan T. DeKok <aland@freeradius.org>
Wed, 6 Mar 2013 14:03:30 +0000 (09:03 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 6 Mar 2013 14:05:56 +0000 (09:05 -0500)
commit03a789e4f792da73203ca1d23c7e6ffa38fbb6ac
tree8f0e71281459749939c992c70cb520e5c95357ee
parentb9e089c07fd63c733b42ae3a162ff5fe2a56d740
Fix userparse function

Remove quadratic addition of vp to list.  Instead, keep track
of the current tail, insert it there, and then add the entire list
in one swell foop.

Also check if we're returning T_OP_INVALID, and if so, free the
intermediate VPs.  This ensures that we either return something,
or an error and nothing else.

It also means that the caller doesn't have to worry about freeing
intermediate VPs if there's a parse error on later ones
src/lib/valuepair.c