Browse Source

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

Miklos Tirpak 16 years ago
parent
commit
61c7aeed70
1 changed files with 4 additions and 1 deletions
  1. 4 1
      usr_avp.c

+ 4 - 1
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)