regfree() function call is added to free the memory allocated by regcomp().
authorMiklos Tirpak <miklos@iptel.org>
Tue, 3 Mar 2009 12:46:40 +0000 (12:46 +0000)
committerMiklos Tirpak <miklos@iptel.org>
Tue, 3 Mar 2009 12:46:40 +0000 (12:46 +0000)
usr_avp.c

index 70dae5c..c7910ff 100644 (file)
--- 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)