[SR-Dev] git:master: Split free_to to two functions: free_to_params and free_to.

Jan Janak jan at iptel.org
Sun Mar 15 23:43:54 CET 2009


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

Author: Jan Janak <jan at iptel.org>
Committer: Jan Janak <jan at iptel.org>
Date:   Sun Mar 15 21:02:57 2009 +0100

Split free_to to two functions: free_to_params and free_to.

This patch splits the function free_to to two functions, free_to_params
which only destroys the linked list of parameters and free_to which
calls free_to_params internally and also frees the entire to header
structure.

---

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

diff --git a/parser/parse_to.c b/parser/parse_to.c
index cf3600f..a493820 100644
--- a/parser/parse_to.c
+++ b/parser/parse_to.c
@@ -773,7 +773,7 @@ error:
 }
 
 
-void free_to(struct to_body* tb)
+void free_to_params(struct to_body* tb)
 {
 	struct to_param *tp=tb->param_lst;
 	struct to_param *foo;
@@ -782,5 +782,11 @@ void free_to(struct to_body* tb)
 		pkg_free(tp);
 		tp=foo;
 	}
+}
+
+
+void free_to(struct to_body* tb)
+{
+	free_to_params(tb);
 	pkg_free(tb);
 }
diff --git a/parser/parse_to.h b/parser/parse_to.h
index 08e4fc4..1c34012 100644
--- a/parser/parse_to.h
+++ b/parser/parse_to.h
@@ -65,6 +65,7 @@ struct to_body{
  */
 char* parse_to(char* buffer, char *end, struct to_body *to_b);
 
+void free_to_params(struct to_body* tb);
 
 void free_to(struct to_body* tb);
 




More information about the sr-dev mailing list