diff options
Diffstat (limited to 'src/fe_utils/conditional.c')
-rw-r--r-- | src/fe_utils/conditional.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/fe_utils/conditional.c b/src/fe_utils/conditional.c index 0bf877e895b..5a946649897 100644 --- a/src/fe_utils/conditional.c +++ b/src/fe_utils/conditional.c @@ -24,13 +24,25 @@ conditional_stack_create(void) } /* - * destroy stack + * Destroy all the elements from the stack. The stack itself is not freed. */ void -conditional_stack_destroy(ConditionalStack cstack) +conditional_stack_reset(ConditionalStack cstack) { + if (!cstack) + return; /* nothing to do here */ + while (conditional_stack_pop(cstack)) continue; +} + +/* + * destroy stack + */ +void +conditional_stack_destroy(ConditionalStack cstack) +{ + conditional_stack_reset(cstack); free(cstack); } |