[sr-dev] git:4.1: core/parser: Free rr correctly in error cases

Hugh Waite hugh.waite at acision.com
Wed Aug 13 10:43:07 CEST 2014


Module: sip-router
Branch: 4.1
Commit: 8ce72b602046e39c862c7db7eb885ca4b3ac960c
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8ce72b602046e39c862c7db7eb885ca4b3ac960c

Author: Hugh Waite <hugh.waite at acision.com>
Committer: Hugh Waite <hugh.waite at acision.com>
Date:   Tue Aug 12 19:56:45 2014 +0100

core/parser: Free rr correctly in error cases

- Fix potential memory leak if parameters are parsed into rr structure
(cherry picked from commit b40d92962b680ac29dd38ffe3c8f1aa1e39d3a97)

---

 parser/parse_rr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/parser/parse_rr.c b/parser/parse_rr.c
index d3a2938..e3df4f3 100644
--- a/parser/parse_rr.c
+++ b/parser/parse_rr.c
@@ -138,7 +138,7 @@ static inline int do_parse_rr_body(char *buf, int len, rr_t **head)
 	}
 
  error:
-	if (r) pkg_free(r);
+	if (r) free_rr(r);
 	free_rr(head); /* Free any contacts created so far */
 	return -1;
 




More information about the sr-dev mailing list