summaryrefslogtreecommitdiff
path: root/sys/modules/lua
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2017-04-16 17:45:12 +0000
committerriastradh <riastradh@NetBSD.org>2017-04-16 17:45:12 +0000
commit8ada1c88b5f8a714394d67f03667e23406cba6e5 (patch)
tree59782b36031543a6a490a8c90b1780c1172692d0 /sys/modules/lua
parentf8ad2df38432ef4da1216aca1843a251a445e066 (diff)
Can't destroy pb until we're done using it.
Diffstat (limited to 'sys/modules/lua')
-rw-r--r--sys/modules/lua/lua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/modules/lua/lua.c b/sys/modules/lua/lua.c
index 7d574f5df13..37a32a59700 100644
--- a/sys/modules/lua/lua.c
+++ b/sys/modules/lua/lua.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lua.c,v 1.19 2017/01/20 12:25:07 maya Exp $ */
+/* $NetBSD: lua.c,v 1.20 2017/04/16 17:45:12 riastradh Exp $ */
/*
* Copyright (c) 2014 by Lourival Vieira Neto <lneto@NetBSD.org>.
@@ -401,8 +401,8 @@ luaioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
if (pb == NULL)
return ENOMEM;
NDINIT(&nd, LOOKUP, FOLLOW | NOCHROOT, pb);
- pathbuf_destroy(pb);
error = vn_open(&nd, FREAD, 0);
+ pathbuf_destroy(pb);
if (error) {
if (lua_verbose)
device_printf(sc->sc_dev,