summaryrefslogtreecommitdiffstats
path: root/src/b_export.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/b_export.c')
-rw-r--r--src/b_export.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/b_export.c b/src/b_export.c
index 9fe5709..9a7c37d 100644
--- a/src/b_export.c
+++ b/src/b_export.c
@@ -64,28 +64,16 @@ static void
while (msh->envp[i] != NULL)
i++;
if (!(nenvp = (char**)malloc((i + 2) * sizeof(char*))))
- {
- lcom_clear(&msh->curr);
- s_destroy(msh);
- f_fail_alloc(msh);
- }
+ f_fail_alloc_and_destroy(msh);
i = 0;
while (msh->envp[i] != NULL)
{
if (!(nenvp[i] = ft_strdup(msh->envp[i])))
- {
- lcom_clear(&msh->curr);
- s_destroy(msh);
- f_fail_alloc(msh);
- }
+ f_fail_alloc_and_destroy(msh);
i++;
}
if (!(nenvp[i] = ft_strdup(var)))
- {
- lcom_clear(&msh->curr);
- s_destroy(msh);
- f_fail_alloc(msh);
- }
+ f_fail_alloc_and_destroy(msh);
nenvp[i + 1] = 0;
ft_delwords(msh->envp);
lvars_delone(&msh->vars, varname);