aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wordsplit.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/wordsplit.c b/wordsplit.c
index 99a8b4f..1950894 100644
--- a/wordsplit.c
+++ b/wordsplit.c
@@ -531,7 +531,7 @@ wsnode_remove (struct wordsplit *wsp, struct wordsplit_node *node)
else
wsp->ws_tail = node->prev;
- node->next = node->prev = NULL;
+ wsnode_free (node);
}
static struct wordsplit_node *
@@ -669,9 +669,8 @@ coalesce_segment (struct wordsplit *wsp, struct wordsplit_node *node)
if (p != node)
{
node->flags |= p->flags & _WSNF_QUOTE;
- wsnode_remove (wsp, p);
stop = p == end;
- wsnode_free (p);
+ wsnode_remove (wsp, p);
}
p = next;
}
@@ -1787,7 +1786,6 @@ node_expand (struct wordsplit *wsp, struct wordsplit_node *node,
if (tail != node)
{
wsnode_remove (wsp, node);
- wsnode_free (node);
}
return 0;
}
@@ -1806,7 +1804,6 @@ wsnode_nullelim (struct wordsplit *wsp)
if (p->flags & _WSNF_NULL)
{
wsnode_remove (wsp, p);
- wsnode_free (p);
}
p = next;
}
@@ -2132,7 +2129,6 @@ wordsplit_pathexpand (struct wordsplit *wsp)
if (wsp->ws_options & WRDSO_NULLGLOB)
{
wsnode_remove (wsp, p);
- wsnode_free (p);
}
else if (wsp->ws_options & WRDSO_FAILGLOB)
{
@@ -2174,7 +2170,6 @@ wordsplit_pathexpand (struct wordsplit *wsp)
globfree (&g);
wsnode_remove (wsp, p);
- wsnode_free (p);
}
}
free (pattern);

Return to:

Send suggestions and report system problems to the System administrator.