Module: kamailio
Branch: master
Commit: 7c3612c27425c04912c879af463f74831b17c5e4
URL:
https://github.com/kamailio/kamailio/commit/7c3612c27425c04912c879af463f748…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-10T12:08:25+02:00
core: parser - clean header in case of parsing error
---
Modified: src/core/parser/msg_parser.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7c3612c27425c04912c879af463f748…
Patch:
https://github.com/kamailio/kamailio/commit/7c3612c27425c04912c879af463f748…
---
diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index 39ed0c437c..1e24b21e49 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -609,7 +609,10 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags,
const int
error:
ser_error=E_BAD_REQ;
- if (hf) pkg_free(hf);
+ if (hf) {
+ clean_hdr_field(hf);
+ pkg_free(hf);
+ }
/* restore original flags */
msg->parsed_flag |= orig_flag;
return -1;