fix memory leaks
This commit is contained in:
parent
a41e25b12a
commit
94a32f28f6
@ -218,6 +218,10 @@ void echo(StringArray *args) {
|
|||||||
}
|
}
|
||||||
fprintf(stdout, "%s", value);
|
fprintf(stdout, "%s", value);
|
||||||
}
|
}
|
||||||
|
if (variable != NULL) {
|
||||||
|
free(variable);
|
||||||
|
variable = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (i != 1) {
|
if (i != 1) {
|
||||||
@ -236,4 +240,5 @@ void echo(StringArray *args) {
|
|||||||
}
|
}
|
||||||
fprintf(stderr, "The variable %s doesn't exist!\n", no_variables->array[i]);
|
fprintf(stderr, "The variable %s doesn't exist!\n", no_variables->array[i]);
|
||||||
}
|
}
|
||||||
|
free_string_array(no_variables);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user