Ver código fonte

modules/ims_usrloc_scscf: Fixed pkg_memory - not freeing DB_RES

Jason Penton 11 anos atrás
pai
commit
b2d4efa0e2

+ 8 - 8
modules/ims_usrloc_scscf/udomain.c

@@ -343,14 +343,14 @@ void mem_timer_udomain(udomain_t* _d) {
 	    ptr = ptr->next;
 	    timer_impurecord(t);
 
-	    			if (t->reg_state == IMPU_NOT_REGISTERED && t->shead == 0) {
-	    				//remove it - housekeeping - not sure why its still here...?
-	    				if (exists_ulcb_type(t->cbs, UL_IMPU_NR_DELETE))
-	    					run_ul_callbacks(t->cbs, UL_IMPU_NR_DELETE, t, NULL);
-	    					    
-	    				LM_DBG("about to delete impurecord\n");
-	    				delete_impurecord(_d, &t->public_identity, t);
-	    			} //else if (t->reg_state == IMPU_UNREGISTERED) {//Remove IMPU record if it is in state IMPU_UNREGISTERED and has expired
+//	    			if (t->reg_state == IMPU_NOT_REGISTERED && t->shead == 0) {
+//	    				//remove it - housekeeping - not sure why its still here...?
+//	    				if (exists_ulcb_type(t->cbs, UL_IMPU_NR_DELETE))
+//	    					run_ul_callbacks(t->cbs, UL_IMPU_NR_DELETE, t, NULL);
+//	    					    
+//	    				LM_DBG("about to delete impurecord\n");
+//	    				delete_impurecord(_d, &t->public_identity, t);
+//	    			} //else if (t->reg_state == IMPU_UNREGISTERED) {//Remove IMPU record if it is in state IMPU_UNREGISTERED and has expired
 	    //			    
 	    //				if (time_now >= t->expires) {//check here and only remove if no subscribes - if there is a subscribe then bump the validity by unreg_validity
 	    //				    if(t->shead != 0){

+ 2 - 0
modules/ims_usrloc_scscf/usrloc_db.c

@@ -946,6 +946,7 @@ int db_link_contact_to_impu(impurecord_t* _r, ucontact_t* _c) {
 	LM_ERR("Unable to link impu-contact in DB - impu [%.*s], contact [%.*s]\n", _r->public_identity.len, _r->public_identity.s, _c->c.len, _c->c.s);
 	return -1;
     }
+    ul_dbf.free_result(ul_dbh, rs);
     LM_DBG("Query success\n");
 
     return 0;
@@ -979,6 +980,7 @@ int db_unlink_contact_from_impu(impurecord_t* _r, ucontact_t* _c) {
 	LM_ERR("Unable to un-link impu-contact in DB - impu [%.*s], contact [%.*s]\n", _r->public_identity.len, _r->public_identity.s, _c->c.len, _c->c.s);
 	return -1;
     }
+    ul_dbf.free_result(ul_dbh, rs);
     LM_DBG("Delete query success\n");
 
     return 0;