mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
occtl: free the talloc pool on exit
This eliminates any memory leaks pointed by asan. Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
@@ -558,6 +558,7 @@ int main(int argc, char **argv)
|
||||
const char *file = NULL;
|
||||
void *gl_pool;
|
||||
cmd_params_st params;
|
||||
int ret;
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
|
||||
@@ -615,7 +616,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* handle all arguments as a command */
|
||||
exit(single_cmd(argc, argv, gl_pool, file, ¶ms));
|
||||
ret = single_cmd(argc, argv, gl_pool, file, ¶ms);
|
||||
talloc_free(gl_pool);
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
interactive:
|
||||
@@ -634,5 +637,6 @@ int main(int argc, char **argv)
|
||||
|
||||
conn_close(conn);
|
||||
|
||||
talloc_free(gl_pool);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user