Fix access after free (Coverity 4178)

This commit is contained in:
manu 2006-09-28 20:09:35 +00:00
parent 695fa2b8b8
commit 87b827ea10
2 changed files with 7 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2006-09-28 Emmanuel Dreyfus <manu@netbsd.org>
* src/racoon/racoonctl.c: Fix access after free (Coverity)
2006-09-26 Emmanuel Dreyfus <manu@netbsd.org>
* src/racoon/admin.c: Fix memory leaks in racoonctl (Coverity)
* src/racoon/admin.c: Remove dead code (Coverity)

View File

@ -1,4 +1,4 @@
/* $NetBSD: racoonctl.c,v 1.4 2006/09/09 16:22:10 manu Exp $ */
/* $NetBSD: racoonctl.c,v 1.5 2006/09/28 20:09:36 manu Exp $ */
/* Id: racoonctl.c,v 1.11 2006/04/06 17:06:25 manubsd Exp */
@ -338,11 +338,11 @@ evt_poll(void) {
if ((sendbuf = f_getevt(0, NULL)) == NULL)
errx(1, "Cannot make combuf");
com_init();
while (evt_filter & (EVTF_LOOP|EVTF_PURGE)) {
com_init();
if (com_send(sendbuf) != 0)
errx(1, "Cannot send combuf");
vfree(sendbuf);
if (com_recv(&recvbuf) == 0) {
handle_recv(recvbuf);
@ -354,7 +354,7 @@ evt_poll(void) {
(void)select(0, NULL, NULL, NULL, &tv);
}
/* NOTREACHED */
vfree(sendbuf);
return 0;
}