Module: kamailio
Branch: master
Commit: 04dc5d6c66c85d0d411aa23b27bc6be00258eff6
URL:
https://github.com/kamailio/kamailio/commit/04dc5d6c66c85d0d411aa23b27bc6be…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-12-02T09:45:48+01:00
auth_diameter: init variable and check before freeing
---
Modified: src/modules/auth_diameter/message.c
---
Diff:
https://github.com/kamailio/kamailio/commit/04dc5d6c66c85d0d411aa23b27bc6be…
Patch:
https://github.com/kamailio/kamailio/commit/04dc5d6c66c85d0d411aa23b27bc6be…
---
diff --git a/src/modules/auth_diameter/message.c b/src/modules/auth_diameter/message.c
index ad81816a42..2dcb80de16 100644
--- a/src/modules/auth_diameter/message.c
+++ b/src/modules/auth_diameter/message.c
@@ -185,7 +185,7 @@ AAAMessage* AAATranslateMessage( unsigned char* source, unsigned int
sourceLen,
int attach_buf)
{
unsigned char *ptr;
- AAAMessage *msg;
+ AAAMessage *msg = NULL;
unsigned char version;
unsigned int msg_len;
AAA_AVP *avp;
@@ -310,7 +310,9 @@ AAAMessage* AAATranslateMessage( unsigned char* source, unsigned int
sourceLen,
return msg;
error:
LM_ERR(" message conversion dropped!!\n");
- AAAFreeMessage(&msg);
+ if (msg) {
+ AAAFreeMessage(&msg);
+ }
return 0;
}