catch sodium_init() return

This commit is contained in:
TLINDEN
2015-11-15 17:02:51 +01:00
parent ab3ff3182e
commit f7aa9d7aaf
5 changed files with 8 additions and 5 deletions

View File

@@ -43,7 +43,10 @@ PCPCTX *ptx_new() {
p->pcppubkey_hash = NULL;
p->pcpkeysig_hash = NULL;
sodium_init();
if(sodium_init() == -1) {
perror("failed to initialize libsodium");
exit(1);
}
return p;
}