add check to free
This commit is contained in:
parent
13d46e8c60
commit
b1dc92ba92
@ -51,7 +51,10 @@ void loop() {
|
|||||||
atexit(exit_cleanup);
|
atexit(exit_cleanup);
|
||||||
char *cwd = get_working_directory();
|
char *cwd = get_working_directory();
|
||||||
set_array_list(variables, "PWD", cwd);
|
set_array_list(variables, "PWD", cwd);
|
||||||
|
if (cwd != NULL) {
|
||||||
free(cwd);
|
free(cwd);
|
||||||
|
cwd = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
print_input_line();
|
print_input_line();
|
||||||
|
Loading…
Reference in New Issue
Block a user