diff options
Diffstat (limited to 'src/server_lds.c')
| -rw-r--r-- | src/server_lds.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server_lds.c b/src/server_lds.c index 2fe508f..a9a68bc 100644 --- a/src/server_lds.c +++ b/src/server_lds.c @@ -111,9 +111,20 @@ main (int argc, char *argv[]) return EXIT_FAILURE; } + const char *trustStore = configRequire (&cfg, "trustStore", "ServerLDS"); + if (!trustStore) + { + configFree (&cfg); + return EXIT_FAILURE; + } + char **trustPaths = NULL; size_t trustSize = 0; - configGetAll (&cfg, "trustList", &trustPaths, &trustSize); + if (loadTrustStore (trustStore, &trustPaths, &trustSize) != 0) + { + configFree (&cfg); + return EXIT_FAILURE; + } UA_StatusCode retval; UA_Server *server @@ -121,7 +132,7 @@ main (int argc, char *argv[]) trustPaths, trustSize, &retval); if (!server) { - free (trustPaths); + freeTrustStore (trustPaths, trustSize); configFree (&cfg); return EXIT_FAILURE; } @@ -147,7 +158,7 @@ main (int argc, char *argv[]) if (retval != UA_STATUSCODE_GOOD) { UA_Server_delete (server); - free (trustPaths); + freeTrustStore (trustPaths, trustSize); configFree (&cfg); return EXIT_FAILURE; } @@ -164,7 +175,7 @@ main (int argc, char *argv[]) retval = UA_Server_run (server, &running); UA_Server_delete (server); - free (trustPaths); + freeTrustStore (trustPaths, trustSize); configFree (&cfg); return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; } |
