(cherry picked from commit 04dc5d6c66c85d0d411aa23b27bc6be00258eff6)
... | ... |
@@ -185,7 +185,7 @@ AAAMessage* AAATranslateMessage( unsigned char* source, unsigned int sourceLen, |
185 | 185 |
int attach_buf) |
186 | 186 |
{ |
187 | 187 |
unsigned char *ptr; |
188 |
- AAAMessage *msg; |
|
188 |
+ AAAMessage *msg = NULL; |
|
189 | 189 |
unsigned char version; |
190 | 190 |
unsigned int msg_len; |
191 | 191 |
AAA_AVP *avp; |
... | ... |
@@ -310,7 +310,9 @@ AAAMessage* AAATranslateMessage( unsigned char* source, unsigned int sourceLen, |
310 | 310 |
return msg; |
311 | 311 |
error: |
312 | 312 |
LM_ERR(" message conversion dropped!!\n"); |
313 |
- AAAFreeMessage(&msg); |
|
313 |
+ if (msg) { |
|
314 |
+ AAAFreeMessage(&msg); |
|
315 |
+ } |
|
314 | 316 |
return 0; |
315 | 317 |
} |
316 | 318 |
|