- When duplicate detection is requested, free the string and container - When duplicate detection is not requested, insert the duplicate anyway
@@ -41,9 +41,11 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
if (cmp == 0)
{
if (duplicate != NULL)
+ {
*duplicate = 1;
- pkg_free(p);
- return list;
+ pkg_free(p);
+ return list;
+ }
}
if (cmp > 0)
@@ -59,9 +61,11 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
p->next = q->next;
@@ -1037,6 +1037,8 @@ int send_resource_subs(char* uri, void* param)
LM_WARN("%.*s has %.*s multiple times in the same resource list\n",
s->watcher_uri->len, s->watcher_uri->s,
s->pres_uri->len, s->pres_uri->s);
+ pkg_free(tmp_str->s);
+ pkg_free(tmp_str);
return 1;