summaryrefslogtreecommitdiff
path: root/sys/modules/lua/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/modules/lua/lua.c')
-rw-r--r--sys/modules/lua/lua.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/modules/lua/lua.c b/sys/modules/lua/lua.c
index 26efb830044..7f69436910e 100644
--- a/sys/modules/lua/lua.c
+++ b/sys/modules/lua/lua.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lua.c,v 1.15 2014/11/30 19:15:03 lneto Exp $ */
+/* $NetBSD: lua.c,v 1.16 2015/02/07 04:09:13 christos Exp $ */
/*
* Copyright (c) 2014 by Lourival Vieira Neto <lneto@NetBSD.org>.
@@ -653,8 +653,10 @@ klua_newstate(lua_Alloc f, void *ud, const char *name, const char *desc,
sc->sc_state = true;
mutex_exit(&sc->sc_state_lock);
- if (error)
+ if (error) {
+ kmem_free(s, sizeof(struct lua_state));
return NULL;
+ }
K = kmem_zalloc(sizeof(klua_State), KM_SLEEP);
K->L = lua_newstate(f, ud);