xengnt_more_entries(): fix memory leak, noticed by Jean-Yves Migeon

This commit is contained in:
bouyer 2008-04-27 19:28:45 +00:00
parent 41434daffd
commit 0fef0ddf92
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: xengnt.c,v 1.6 2008/02/17 14:03:16 bouyer Exp $ */
/* $NetBSD: xengnt.c,v 1.7 2008/04/27 19:28:45 bouyer Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.6 2008/02/17 14:03:16 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.7 2008/04/27 19:28:45 bouyer Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -141,6 +141,7 @@ xengnt_more_entries()
if (setup.status != 0) {
printf("xengnt_more_entries: setup table returned %d\n",
setup.status);
free(pages, M_DEVBUF);
return ENOMEM;
}
@ -160,6 +161,7 @@ xengnt_more_entries()
last_gnt_entry++;
}
gnt_nr_grant_frames = nframes_new;
free(pages, M_DEVBUF);
return 0;
}