Module: kamailio
Branch: master
Commit: fb19f0ea4c656afe7b60788efb8804e552fd37f9
URL:
https://github.com/kamailio/kamailio/commit/fb19f0ea4c656afe7b60788efb8804e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-06-12T16:27:46+02:00
auth_diameter: free req in some cases of errors
---
Modified: src/modules/auth_diameter/authorize.c
---
Diff:
https://github.com/kamailio/kamailio/commit/fb19f0ea4c656afe7b60788efb8804e…
Patch:
https://github.com/kamailio/kamailio/commit/fb19f0ea4c656afe7b60788efb8804e…
---
diff --git a/src/modules/auth_diameter/authorize.c
b/src/modules/auth_diameter/authorize.c
index a3cc682b0c2..a15758754f6 100644
--- a/src/modules/auth_diameter/authorize.c
+++ b/src/modules/auth_diameter/authorize.c
@@ -255,12 +255,12 @@ int authorize(struct sip_msg *msg, pv_elem_t *realm, int hftype)
/*
* This function creates and submits diameter authentication request as per
- * draft-srinivas-aaa-basic-digest-00.txt.
+ * draft-srinivas-aaa-basic-digest-00.txt.
* Service type of the request is Authenticate-Only.
* Returns:
* 1 - success
* -1 - error
- *
+ *
*/
int diameter_authorize(struct hdr_field *hdr, str *p_method, sip_uri_t *uri,
sip_uri_t *ruri, unsigned int m_id, rd_buf_t *rb)
@@ -294,6 +294,7 @@ int diameter_authorize(struct hdr_field *hdr, str *p_method, sip_uri_t
*uri,
user_name.s = (char *)ad_malloc(user_name.len * sizeof(char));
if(!(user_name.s)) {
PKG_MEM_ERROR;
+ AAAFreeMessage(&req);
return -1;
}
memset(user_name.s, 0, user_name.len);
@@ -417,6 +418,7 @@ int diameter_authorize(struct hdr_field *hdr, str *p_method, sip_uri_t
*uri,
user_name.s = (char *)ad_malloc(user_name.len * sizeof(char));
if(!(user_name.s)) {
PKG_MEM_ERROR;
+ AAAFreeMessage(&req);
return -1;
}
memset(user_name.s, 0, user_name.len);