]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: Fix sizeof usage for struct event* storage
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 6 Nov 2018 19:00:47 +0000 (21:00 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 6 Nov 2018 19:04:42 +0000 (21:04 +0200)
Found by coverity

src/lib-lua/dlua-dovecot.c

index 7b29e96eff1925c1b9fb73f97de7860464345f38..2950489806a667ded497cf6886870e672d2bd29e 100644 (file)
@@ -282,7 +282,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);