Module: kamailio
Branch: master
Commit: 84cdc33429c61fe7cac91cbedf96bef560267313
URL:
https://github.com/kamailio/kamailio/commit/84cdc33429c61fe7cac91cbedf96bef…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-22T08:12:20+01:00
auth_identity: close file in case of errors
- GH #2983
---
Modified: src/modules/auth_identity/auth_identity.c
---
Diff:
https://github.com/kamailio/kamailio/commit/84cdc33429c61fe7cac91cbedf96bef…
Patch:
https://github.com/kamailio/kamailio/commit/84cdc33429c61fe7cac91cbedf96bef…
---
diff --git a/src/modules/auth_identity/auth_identity.c
b/src/modules/auth_identity/auth_identity.c
index 4b4bb4bb08..d43df5a6c5 100644
--- a/src/modules/auth_identity/auth_identity.c
+++ b/src/modules/auth_identity/auth_identity.c
@@ -359,18 +359,22 @@ static int mod_init(void)
}
if (x509_get_notafter(&glb_imycertnotafter, pmycert)) {
LOG(L_ERR, "AUTH_IDENTITY:mod_init: Error getting certificate expiration
date\n");
+ fclose(hpemfile);
return -13;
}
if (x509_get_notbefore(&ttmp, pmycert)) {
LOG(L_ERR, "AUTH_IDENTITY:mod_init: Error getting certificate validity
date\n");
+ fclose(hpemfile);
return -13;
}
if ((tnow=time(0)) < 0) {
LOG(L_ERR, "AUTH_IDENTITY:mod_init: time error %s\n", strerror(errno));
+ fclose(hpemfile);
return -13;
}
if (tnow < ttmp || tnow > glb_imycertnotafter) {
LOG(L_ERR, "AUTH_IDENTITY:mod_init: Date of certificate is invalid (%s)\n",
glb_sservercertpath);
+ fclose(hpemfile);
return -14;
}