[SR-Dev] git:ser_core_cvs: regfree() function call is added to free the memory allocated by regcomp().

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Mar 5 18:33:52 CET 2009


Module: sip-router
Branch: ser_core_cvs
Commit: 61c7aeed70e34cb952d76472acef0dbf76cec1ce
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=61c7aeed70e34cb952d76472acef0dbf76cec1ce

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Miklos Tirpak <miklos at iptel.org>
Date:   Tue Mar  3 12:46:40 2009 +0000

regfree() function call is added to free the memory allocated by regcomp().

---

 usr_avp.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/usr_avp.c b/usr_avp.c
index 70dae5c..c7910ff 100644
--- a/usr_avp.c
+++ b/usr_avp.c
@@ -991,6 +991,7 @@ void free_avp_ident(avp_ident_t* attr)
 			abort();
 #endif
 		} else {
+			regfree(attr->name.re);
 			pkg_free(attr->name.re);
 		}
 	}
@@ -1019,8 +1020,10 @@ int parse_avp_spec( str *name, int *type, int_str *avp_name, int *index)
 
 void free_avp_name( int *type, int_str *avp_name)
 {
-	if ((*type & AVP_NAME_RE) && (avp_name->re))
+	if ((*type & AVP_NAME_RE) && (avp_name->re)) {
+		regfree(avp_name->re);
 		pkg_free(avp_name->re);
+	}
 }
 
 int add_avp_galias_str(char *alias_definition)




More information about the sr-dev mailing list