Cleanup library if daemon initialization fails
authorMartin Willi <martin@strongswan.org>
Thu, 3 Dec 2009 06:56:19 +0000 (07:56 +0100)
committerMartin Willi <martin@strongswan.org>
Thu, 3 Dec 2009 07:00:43 +0000 (08:00 +0100)
src/charon/daemon.c

index 0ade118..06495df 100644 (file)
@@ -767,6 +767,7 @@ int main(int argc, char *argv[])
        {
                DBG1(DBG_DMN, "initialization failed - aborting charon");
                destroy(private_charon);
+               library_deinit();
                exit(SS_RC_INITIALIZATION_FAILED);
        }
 
@@ -774,6 +775,7 @@ int main(int argc, char *argv[])
        {
                DBG1(DBG_DMN, "charon already running (\""PID_FILE"\" exists)");
                destroy(private_charon);
+               library_deinit();
                exit(-1);
        }