Bläddra i källkod

- replaced all mallocs/frees with pkg_malloc/pkg_free

Andrei Pelinescu-Onciul 22 år sedan
förälder
incheckning
8710b7eef2
5 ändrade filer med 30 tillägg och 17 borttagningar
  1. 4 2
      modules/tm/t_funcs.c
  2. 3 1
      modules/tm/t_fwd.c
  3. 7 1
      modules/tm/t_hooks.c
  4. 5 3
      modules/tm/tm.c
  5. 11 10
      modules/tm/uac.c

+ 4 - 2
modules/tm/t_funcs.c

@@ -33,6 +33,7 @@
  *  2003-02-13  modified send_pr_buffer to use msg_send & rb->dst (andrei)
  *  2003-03-13  send_pr_buffer is called w/ file/function/line debugging
  *               info only if compiling w/ -DEXTRA_DEBUG (andrei)
+ *  2003-03-19  replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei)
  */
 
 
@@ -46,6 +47,7 @@
 #include "../../ut.h"
 #include "../../hash_func.h"
 #include "../../dset.h"
+#include "../../mem/mem.h"
 #include "t_funcs.h"
 #include "t_fwd.h"
 #include "t_lookup.h"
@@ -233,7 +235,7 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy, int proto,
 			}
 			ret=forward_request( p_msg , proxy, proto) ;
 			free_proxy( proxy );	
-			free( proxy );
+			pkg_free( proxy );
 #ifdef ACK_FORKING_HACK
 			backup_uri=p_msg->new_uri;
 			init_branch_iterator();
@@ -243,7 +245,7 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy, int proto,
 				if (proxy==0) continue;
 				forward_request(p_msg, proxy, proto);
 				free_proxy( proxy );	
-				free( proxy );
+				pkg_free( proxy );
 			}
 			p_msg->new_uri=backup_uri;
 #endif

+ 3 - 1
modules/tm/t_fwd.c

@@ -32,6 +32,7 @@
  *  2003-02-24  s/T_NULL/T_NULL_CELL/ to avoid redefinition conflict w/
  *              nameser_compat.h (andrei)
  *  2003-02-13  proto support added (andrei)
+ *  2003-03-19  replaced all the mallocs/frees w/ pkg_malloc/pkg_free (andrei)
  */
 
 #include "defs.h"
@@ -44,6 +45,7 @@
 #include "../../timer.h"
 #include "../../hash_func.h"
 #include "../../globals.h"
+#include "../../mem/mem.h"
 #include "../../dset.h"
 #include "t_funcs.h"
 #include "t_hooks.h"
@@ -238,7 +240,7 @@ int add_uac( struct cell *t, struct sip_msg *request, str *uri,
 error01:
 	if (temp_proxy) {
 		free_proxy( proxy );
-		free( proxy );
+		pkg_free( proxy );
 	}
 error:
 	return ret;

+ 7 - 1
modules/tm/t_hooks.c

@@ -24,6 +24,11 @@
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+/*
+ * History:
+ * --------
+ *  2003-03-19  replaced all the mallocs/frees w/ pkg_malloc/pkg_free (andrei)
+ */
 
 #include "defs.h"
 
@@ -31,6 +36,7 @@
 #include "stdlib.h"
 #include "../../dprint.h"
 #include "../../error.h"
+#include "../../mem/mem.h"
 #include "t_hooks.h"
 
 /* strange things happen if callback_array is static on openbsd */
@@ -50,7 +56,7 @@ int register_tmcb( tmcb_type cbt, transaction_cb f, void *param )
 		return E_BUG;
 	}
 
-	if (!(cbs=malloc( sizeof( struct tm_callback_s)))) {
+	if (!(cbs=pkg_malloc( sizeof( struct tm_callback_s)))) {
 		LOG(L_ERR, "ERROR: register_tmcb: out of mem\n");
 		return E_OUT_OF_MEM;
 	}

+ 5 - 3
modules/tm/tm.c

@@ -59,6 +59,7 @@
  *  2003-02-19  added t_rely_{udp, tcp} (andrei)
  *  2003-03-10  module export interface updated to the new format (andrei)
  *  2003-03-16  flags export parameter added (janakj)
+ *  2003-03-19  replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei)
  */
 
 
@@ -75,6 +76,7 @@
 #include "../../ut.h"
 #include "../../script_cb.h"
 #include "../../fifo_server.h"
+#include "../../mem/mem.h"
 
 #include "sip_msg.h"
 #include "h_table.h"
@@ -201,7 +203,7 @@ inline static int fixup_str2int( void** param, int param_no)
 	if (param_no==1) {
 		go_to=str2s(*param, strlen(*param), &err );
 		if (err==0) {
-			free(*param);
+			pkg_free(*param);
 			*param=(void *)go_to;
 			return 0;
 		} else {
@@ -346,7 +348,7 @@ inline static int fixup_hostport2proxy(void** param, int param_no)
 		/* success -- fix the first parameter to proxy now ! */
 
 		/* FIXME: janakj, mk_proxy doesn't make copy of host !! */
-		free( *(param-1));
+		/*pkg_free( *(param-1)); you're right --andrei*/
 		*(param-1)=proxy;
 		return 0;
 	} else {
@@ -365,7 +367,7 @@ inline static int fixup_t_send_reply(void** param, int param_no)
 	if (param_no==1){
 		code=str2s(*param, strlen(*param), &err);
 		if (err==0){
-			free(*param);
+			pkg_free(*param);
 			*param=(void*)code;
 			return 0;
 		}else{

+ 11 - 10
modules/tm/uac.c

@@ -44,14 +44,15 @@
  *
  * History:
  * --------
- * 2003-03-01  kr set through a function now (jiri)
- * 2003-02-28 scratchpad compatibility abandoned (jiri)
- * 2003-02-27 FIFO/UAC now dumps reply -- good for CTD (jiri)
- * 2003-02-13  t_uac, t _uac_dlg, gethfblock, uri2proxy changed to use 
- *              proto & rb->dst (andrei)
- * 2003-01-29  scratchpad removed (jiri)
- * 2003-01-27  fifo:t_uac_dlg completed (jiri)
- * 2003-01-23  t_uac_dlg now uses get_out_socket (jiri)
+ *  2003-01-23  t_uac_dlg now uses get_out_socket (jiri)
+ *  2003-01-27  fifo:t_uac_dlg completed (jiri)
+ *  2003-01-29  scratchpad removed (jiri)
+ *  2003-02-13  t_uac, t _uac_dlg, gethfblock, uri2proxy changed to use 
+ *               proto & rb->dst (andrei)
+ *  2003-02-27  FIFO/UAC now dumps reply -- good for CTD (jiri)
+ *  2003-03-01  kr set through a function now (jiri)
+ *  2003-02-28  scratchpad compatibility abandoned (jiri)
+ *  2003-03-19  replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei)
  */
 
 
@@ -225,7 +226,7 @@ static struct socket_info *uri2sock( str *uri, union sockaddr_union *to_su,
 
 
 	free_proxy(proxy);
-	free(proxy);
+	pkg_free(proxy);
 	return send_sock;
 }
 	
@@ -438,7 +439,7 @@ error01:
 error00:
 /*
 	free_proxy(proxy);
-	free(proxy);
+	pkg_free(proxy);
 */
 
 done: