Skip to content
Snippets Groups Projects
Commit 57bf81f9 authored by Raymond Toy's avatar Raymond Toy
Browse files

Don't leak the string created by strdup.

Probably harmless if we do since we exit(0) at the end.
parent 2307b3f7
No related branches found
No related tags found
No related merge requests found
...@@ -249,7 +249,8 @@ boolean ...@@ -249,7 +249,8 @@ boolean
save_executable(char *filename, lispobj init_function) save_executable(char *filename, lispobj init_function)
{ {
char *dir_name; char *dir_name;
char *dir_copy;
#if defined WANT_CGC #if defined WANT_CGC
volatile lispobj *func_ptr = &init_function; volatile lispobj *func_ptr = &init_function;
char sbuf[128]; char sbuf[128];
...@@ -271,7 +272,8 @@ save_executable(char *filename, lispobj init_function) ...@@ -271,7 +272,8 @@ save_executable(char *filename, lispobj init_function)
if(SymbolValue(X86_CGC_ACTIVE_P) != NIL) if(SymbolValue(X86_CGC_ACTIVE_P) != NIL)
SetSymbolValue(ALLOCATION_POINTER, DYNAMIC_0_SPACE_START); SetSymbolValue(ALLOCATION_POINTER, DYNAMIC_0_SPACE_START);
#endif #endif
dir_name = dirname(strdup(filename)); dir_copy = strdup(filename);
dir_name = dirname(dir_copy);
printf("[Undoing binding stack... "); printf("[Undoing binding stack... ");
fflush(stdout); fflush(stdout);
...@@ -357,6 +359,7 @@ save_executable(char *filename, lispobj init_function) ...@@ -357,6 +359,7 @@ save_executable(char *filename, lispobj init_function)
fflush(stdout); fflush(stdout);
obj_run_linker(init_function, filename); obj_run_linker(init_function, filename);
printf("done.\n"); printf("done.\n");
free(dir_copy);
exit(0); exit(0);
} }
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment