Skip to content
Snippets Groups Projects
Commit faddf8e3 authored by Mergen Imeev's avatar Mergen Imeev Committed by Kirill Yukhin
Browse files

netbox: fix memory leak in connect()

This patch fixes memory leak in lbox_tuple_format_new().

Closes #4588

(cherry picked from commit 96199855)
parent 393d4547
No related branches found
No related tags found
No related merge requests found
......@@ -231,6 +231,12 @@ lbox_tuple_format_new(struct lua_State *L)
struct tuple_format *format =
tuple_format_new(&tuple_format_runtime->vtab, NULL, NULL, 0,
NULL, 0, 0, dict, false, false);
/*
* Since dictionary reference counter is 1 from the
* beginning and after creation of the tuple_format
* increases by one, we must decrease it once.
*/
tuple_dictionary_unref(dict);
if (format == NULL)
return luaT_error(L);
return lbox_push_tuple_format(L, format);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment