Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
0555a4c6
Commit
0555a4c6
authored
Jun 12, 2020
by
Firenox89
Committed by
Nathaniel Wesley Filardo
Jun 12, 2020
Browse files
fix a memory leak in ws2812_buffer_shift by freeing the same amount of bytes we allocated before
parent
06aa248f
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/ws2812.c
View file @
0555a4c6
...
@@ -278,7 +278,8 @@ int ws2812_buffer_shift(lua_State* L, ws2812_buffer * buffer, int shiftValue, un
...
@@ -278,7 +278,8 @@ int ws2812_buffer_shift(lua_State* L, ws2812_buffer * buffer, int shiftValue, un
ws2812_buffer_shift_prepare
*
prepare
=
ws2812_buffer_get_shift_prepare
(
L
,
buffer
,
shiftValue
,
shift_type
,
pos_start
,
pos_end
);
ws2812_buffer_shift_prepare
*
prepare
=
ws2812_buffer_get_shift_prepare
(
L
,
buffer
,
shiftValue
,
shift_type
,
pos_start
,
pos_end
);
ws2812_buffer_shift_prepared
(
prepare
);
ws2812_buffer_shift_prepared
(
prepare
);
// Free memory
// Free memory
luaM_free
(
L
,
prepare
);
luaM_freemem
(
L
,
prepare
,
sizeof
(
ws2812_buffer_shift_prepare
)
+
prepare
->
shift_len
);
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment