2
0
Эх сурвалжийг харах

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

Daniel-Constantin Mierla 10 жил өмнө
parent
commit
1b20aa0404

+ 1 - 1
modules/pua/add_events.c

@@ -194,6 +194,7 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa
 				LM_ERR("No more memory\n");
 				goto error;
 			}
+			alloc_tuple= 1;
 			tuple->s= (char*)pkg_malloc(tuple_id_len* sizeof(char));
 			if(tuple->s== NULL)
 			{
@@ -203,7 +204,6 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa
 			memcpy(tuple->s, tuple_id, tuple_id_len);
 			tuple->len= tuple_id_len;
 			*tuple_param= tuple;
-			alloc_tuple= 1;
 		}
 	}