Bläddra i källkod

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.
Jan Janak 16 år sedan
förälder
incheckning
603cd54734
2 ändrade filer med 8 tillägg och 1 borttagningar
  1. 7 1
      parser/parse_to.c
  2. 1 0
      parser/parse_to.h

+ 7 - 1
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);
 }

+ 1 - 0
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);