Module Name: src Committed By: vanhu Date: Wed Mar 2 14:58:27 UTC 2011
Modified Files: src/crypto/dist/ipsec-tools/src/racoon: cfparse.y remoteconf.c remoteconf.h Log Message: free spspec when deleting a rmconf struct. patch by Roman Hoog Antink <r...@open.ch> To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y cvs rdiff -u -r1.23 -r1.24 \ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c cvs rdiff -u -r1.14 -r1.15 \ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/cfparse.y diff -u src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.40 src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.41 --- src/crypto/dist/ipsec-tools/src/racoon/cfparse.y:1.40 Wed Mar 2 14:49:21 2011 +++ src/crypto/dist/ipsec-tools/src/racoon/cfparse.y Wed Mar 2 14:58:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cfparse.y,v 1.40 2011/03/02 14:49:21 vanhu Exp $ */ +/* $NetBSD: cfparse.y,v 1.41 2011/03/02 14:58:27 vanhu Exp $ */ /* Id: cfparse.y,v 1.66 2006/08/22 18:17:17 manubsd Exp */ @@ -145,6 +145,7 @@ static struct secprotospec *newspspec __P((void)); static void insspspec __P((struct remoteconf *, struct secprotospec *)); +void flushspspec __P((struct remoteconf *)); static void adminsock_conf __P((vchar_t *, vchar_t *, vchar_t *, int)); static int set_isakmp_proposal __P((struct remoteconf *)); @@ -2414,6 +2415,25 @@ rmconf->spspec = spspec; } +/* + * delete the whole list + */ +void +flushspspec(rmconf) + struct remoteconf *rmconf; +{ + struct secprotospec *p; + + while(rmconf->spspec != NULL) { + p = rmconf->spspec; + rmconf->spspec = p->next; + if (p->next != NULL) + p->next->prev = NULL; /* not necessary but clean */ + + racoon_free(p); + } +} + /* set final acceptable proposal */ static int set_isakmp_proposal(rmconf) Index: src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c diff -u src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c:1.23 src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c:1.24 --- src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c:1.23 Wed Mar 2 14:52:32 2011 +++ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c Wed Mar 2 14:58:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: remoteconf.c,v 1.23 2011/03/02 14:52:32 vanhu Exp $ */ +/* $NetBSD: remoteconf.c,v 1.24 2011/03/02 14:58:27 vanhu Exp $ */ /* Id: remoteconf.c,v 1.38 2006/05/06 15:52:44 manubsd Exp */ @@ -654,6 +654,7 @@ racoon_free(rmconf->name); if (rmconf->remote) racoon_free(rmconf->remote); + flushspspec(rmconf); racoon_free(rmconf); } Index: src/crypto/dist/ipsec-tools/src/racoon/remoteconf.h diff -u src/crypto/dist/ipsec-tools/src/racoon/remoteconf.h:1.14 src/crypto/dist/ipsec-tools/src/racoon/remoteconf.h:1.15 --- src/crypto/dist/ipsec-tools/src/racoon/remoteconf.h:1.14 Wed Feb 2 15:21:34 2011 +++ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.h Wed Mar 2 14:58:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: remoteconf.h,v 1.14 2011/02/02 15:21:34 vanhu Exp $ */ +/* $NetBSD: remoteconf.h,v 1.15 2011/03/02 14:58:27 vanhu Exp $ */ /* Id: remoteconf.h,v 1.26 2006/05/06 15:52:44 manubsd Exp */ @@ -208,6 +208,7 @@ extern void insrmconf __P((struct remoteconf *)); extern void remrmconf __P((struct remoteconf *)); extern void flushrmconf __P((void)); +extern void flushspspec __P((struct remoteconf *)); extern void initrmconf __P((void)); extern void rmconf_start_reload __P((void)); extern void rmconf_finish_reload __P((void));