Răsfoiți Sursa

modules/ims_charging: removed unused impu_data parcel (memory leak)

jaybeepee 10 ani în urmă
părinte
comite
d73d56b410
2 a modificat fișierele cu 0 adăugiri și 37 ștergeri
  1. 0 31
      modules/ims_charging/mod.c
  2. 0 6
      modules/ims_charging/ro_session_hash.h

+ 0 - 31
modules/ims_charging/mod.c

@@ -378,10 +378,7 @@ static int w_ro_ccr(struct sip_msg *msg, char* c_route_name, char* c_direction,
 	tm_cell_t *t;
 	unsigned int tindex = 0,
 				 tlabel = 0;
-	struct impu_data *impu_data;
-	char *p;
 	struct dlg_cell* dlg;
-	unsigned int len;
 	struct ro_session *ro_session = 0;
 	int free_contact = 0;
 	
@@ -457,34 +454,6 @@ static int w_ro_ccr(struct sip_msg *msg, char* c_route_name, char* c_direction,
 	}
 	
 	LM_DBG("IMPU data to pass to usrloc:  contact <%.*s> identity <%.*s>\n", contact.len, contact.s, identity.len, identity.s);
-	
-	//create impu_data_parcel
-	len = identity.len + contact.len +  sizeof (struct impu_data);
-	impu_data = (struct impu_data*) shm_malloc(len);
-	if (!impu_data) {
-	    LM_ERR("Unable to allocate memory for impu_data, trying to send CCR\n");
-	    ret = RO_RETURN_ERROR;
-	    goto done;
-	}
-	memset(impu_data, 0, len);
-	
-	p = (char*) (impu_data + 1);
-	impu_data->identity.s = p;
-	impu_data->identity.len = identity.len;
-	memcpy(p, identity.s, identity.len);
-	p += identity.len;
-
-	impu_data->contact.s = p;
-	impu_data->contact.len = contact.len;
-	memcpy(p, contact.s, contact.len);
-	p += contact.len;
-	
-	if (p != (((char*) impu_data) + len)) {
-	    LM_ERR("buffer overflow creating impu data, trying to send CCR\n");
-	    shm_free(impu_data);
-	    ret = RO_RETURN_ERROR;
-	    goto done;
-	}
 
 send_ccr:
 

+ 0 - 6
modules/ims_charging/ro_session_hash.h

@@ -172,12 +172,6 @@ static inline void unlink_unsafe_ro_session(struct ro_session_entry *ro_session_
  */
 int init_ro_session_table(unsigned int size);
 
-/*!
- * \brief Destroy a ro_session and free memory
- * \param ro_session destroyed Ro Session
- */
-inline void destroy_ro_session(struct ro_session *ro_session);
-
 /*!
  * \brief Destroy the ro_session dialog table
  */