Procházet zdrojové kódy

Merge branch '5.0' of https://github.com/kamailio/kamailio into 5.0

# By Victor Seva
# Via Victor Seva
* '5.0' of https://github.com/kamailio/kamailio:
  pua_reginfo: fix memory leak when usrloc is DB_ONLY
The Root před 8 roky
rodič
revize
f3e00707bb

+ 1 - 1
src/modules/pua_reginfo/notify.c

@@ -458,7 +458,7 @@ next_contact:
 			}
 		}
 next_registration:
-		// if (ul_record) ul.release_urecord(ul_record);		
+		if (ul_record) ul.release_urecord(ul_record);
 		/* Unlock the domain for this AOR: */
 		if (aor_key.len > 0)
 			ul.unlock_udomain(domain, &aor_key);

+ 2 - 1
src/modules/pua_reginfo/usrloc_cb.c

@@ -223,7 +223,7 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
 	publ_info_t publ;
 	str content_type;
 	udomain_t * domain;
-	urecord_t * record;
+	urecord_t * record = NULL;
 	int res;
 	str uri = {NULL, 0};
 	str user = {NULL, 0};
@@ -332,6 +332,7 @@ error:
 		if(body->s) xmlFree(body->s);
 		pkg_free(body);
 	}
+	if(record) ul.release_urecord(record);
 
 	return;
 }