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

Hugh Waite hugh.waite at acision.com
Wed Aug 13 10:34:27 CEST 2014


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

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

---

 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 fd6d3d9..bba0f7a 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