[sr-dev] git:master: rls: free item in case of duplicate when trying to add to str list

Daniel-Constantin Mierla miconda at gmail.com
Wed May 14 23:44:43 CEST 2014


Module: sip-router
Branch: master
Commit: 71332ed9ce59de50de04c940fd600b50b1f1dc80
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=71332ed9ce59de50de04c940fd600b50b1f1dc80

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed May 14 23:19:05 2014 +0200

rls: free item in case of duplicate when trying to add to str list

---

 modules/rls/list.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/rls/list.h b/modules/rls/list.h
index c9904aa..f65c408 100644
--- a/modules/rls/list.h
+++ b/modules/rls/list.h
@@ -42,6 +42,7 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
 	{
 		if (duplicate != NULL)
 			*duplicate = 1;
+		pkg_free(p);
 		return list;
 	}
 	if (cmp > 0)
@@ -59,6 +60,7 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
 		{
 			if (duplicate != NULL)
 				*duplicate = 1;
+			pkg_free(p);
 			return list;
 		}
 




More information about the sr-dev mailing list