Mercurial > hg > freeDiameter
changeset 52:9bb1006cfa21
Merged
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 27 Nov 2009 17:20:11 +0900 |
parents | 08d8cbeff30b (current diff) dbba83bafd66 (diff) |
children | cd5620362909 |
files | |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/freeDiameter/p_cnx.c Fri Nov 27 17:19:45 2009 +0900 +++ b/freeDiameter/p_cnx.c Fri Nov 27 17:20:11 2009 +0900 @@ -51,10 +51,12 @@ static __inline__ void failed_connection_attempt(struct fd_peer * peer) { - /* Simply remove the first item in the list */ - struct fd_list * li = peer->p_connparams.next; - fd_list_unlink(li); - free(li); + /* Simply remove the first item in the list if not empty */ + if (! FD_IS_LIST_EMPTY(&peer->p_connparams) ) { + struct fd_list * li = peer->p_connparams.next; + fd_list_unlink(li); + free(li); + } } static void empty_connection_list(struct fd_peer * peer)