diff --git a/src/Cedar/IPC.c b/src/Cedar/IPC.c index 3965226d..ab913c8a 100644 --- a/src/Cedar/IPC.c +++ b/src/Cedar/IPC.c @@ -433,6 +433,13 @@ IPC *NewIPC(CEDAR *cedar, char *client_name, char *postfix, char *hubname, char { p = PackLoginWithPlainPassword(hubname, username, password); } + + if (p == NULL) + { + err = ERR_AUTH_FAILED; + goto LABEL_ERROR; + } + PackAddStr(p, "hello", client_name); PackAddInt(p, "client_ver", cedar->Version); PackAddInt(p, "client_build", cedar->Build); diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index d7609f68..df586b0e 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -7126,6 +7126,7 @@ PACK *PackLoginWithOpenVPNCertificate(char *hubname, char *username, X *x) { if (x->subject_name == NULL) { + FreePack(p); return NULL; } UniToStr(cn_username, sizeof(cn_username), x->subject_name->CommonName);