Browse code

pua: mark that tupple was allocated so can be freed in case of errors

(cherry picked from commit 1b20aa04048d15d0861b3f5291fd3b9a1614fdf5)

Daniel-Constantin Mierla authored on 14/05/2015 11:09:47
Showing 1 changed files
... ...
@@ -197,6 +197,7 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa
197 197
 				LM_ERR("No more memory\n");
198 198
 				goto error;
199 199
 			}
200
+			alloc_tuple= 1;
200 201
 			tuple->s= (char*)pkg_malloc(tuple_id_len* sizeof(char));
201 202
 			if(tuple->s== NULL)
202 203
 			{
... ...
@@ -206,7 +207,6 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa
206 207
 			memcpy(tuple->s, tuple_id, tuple_id_len);
207 208
 			tuple->len= tuple_id_len;
208 209
 			*tuple_param= tuple;
209
-			alloc_tuple= 1;
210 210
 		}
211 211
 	}
212 212