From: Aki Tuomi Date: Tue, 6 Nov 2018 19:00:47 +0000 (+0200) Subject: lib-lua: Fix sizeof usage for struct event* storage X-Git-Tag: 2.3.4~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=346816e2142442f5bce0eff2d3d74b54a03aabcb;p=thirdparty%2Fdovecot%2Fcore.git lib-lua: Fix sizeof usage for struct event* storage Found by coverity --- diff --git a/src/lib-lua/dlua-dovecot.c b/src/lib-lua/dlua-dovecot.c index 8aef36df89..e80b40e752 100644 --- a/src/lib-lua/dlua-dovecot.c +++ b/src/lib-lua/dlua-dovecot.c @@ -280,7 +280,7 @@ void dlua_push_event(struct dlua_script *script, struct event *event) luaL_setmetatable(script->L, DLUA_EVENT); /* we need to attach gc to userdata to support older lua*/ - struct event **ptr = lua_newuserdata(script->L, sizeof(struct event**)); + struct event **ptr = lua_newuserdata(script->L, sizeof(struct event*)); *ptr = event; lua_createtable(script->L, 0, 1); lua_pushcfunction(script->L, dlua_event_gc);