[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: bug in lrexlib?
- From: Thatcher Ulrich <tu@...>
- Date: Mon, 14 Jul 2003 13:55:34 -0400
Hi Reuben,
I've just incorporated your rex and bit libraries into luacheia. Nice
work, I appreciate you releasing these!
Anyway, I came across what I think is a bug in lrexlib.c. It appears
that the regex_t userdata is being freed twice; once by rex_gc(), and
then again by Lua. Here's the change I have made in the luacheia
version:
----
static int rex_gc (lua_State *L) {
regex_t *r = (regex_t *)luaL_checkudata(L, 1, "regex_t");
if (r) {
regfree(r);
/* free(r); */ /* luacheia: don't double-free! */
}
return 0;
}
----
--
Thatcher Ulrich
http://tulrich.com