library: standardize extents_free_all() logic, 3rd gen

As those 3rd generation newlib APIs evolved so too did
the extents_free_all() function. Most versions of this
function required the callers to first verify that the
extents anchor wasn't empty, which was poor etiquette.

This simple function should have been much more robust
and forgiving. With this commit, it fnally becomes so.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2016-07-01 00:00:00 -05:00
committed by Craig Small
parent 458845f575
commit eff9fbc06e
5 changed files with 12 additions and 15 deletions

View File

@ -319,11 +319,11 @@ static inline void cleanup_stacks_all (
static void extents_free_all (
struct ext_support *this)
{
do {
while (this->extents) {
struct stacks_extent *p = this->extents;
this->extents = this->extents->next;
free(p);
} while (this->extents);
};
} // end: extents_free_all