summaryrefslogtreecommitdiffstats
path: root/src/u_vars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/u_vars.c')
-rw-r--r--src/u_vars.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/u_vars.c b/src/u_vars.c
index 9978df5..377da77 100644
--- a/src/u_vars.c
+++ b/src/u_vars.c
@@ -127,7 +127,12 @@ static char
}
if (ptr != NULL)
{
- varval = ft_strdup(ptr->val);
+ if (!(varval = ft_strdup(ptr->val)))
+ {
+ lcom_clear(&msh->curr);
+ s_destroy(msh);
+ fail_alloc(msh);
+ }
return (varval);
}
else