]> sigrok.org Git - libsigrok.git/commit - hardware/fx2lafw/fx2lafw.c
sr: fx2lafw: Allocate header and packet struct on the stack
authorLars-Peter Clausen <redacted>
Sun, 24 Jun 2012 10:04:35 +0000 (12:04 +0200)
committerUwe Hermann <redacted>
Wed, 27 Jun 2012 22:40:51 +0000 (00:40 +0200)
commitbd47acabe33813acb7dd6a4ebf155418072b08b7
tree4ffe5c5ee5becad03d46f5839a66aec812948876
parent0c156e06c55a5b69385778fb00292d5866660a7f
sr: fx2lafw: Allocate header and packet struct on the stack

The header and packet struct are only used in the scope of this function and
they are freed at the end of it. Also these structs are rather small, so they
can safely be allocated on the stack. By doing so memory leaks on the error
paths are avoided.

Signed-off-by: Lars-Peter Clausen <redacted>
hardware/fx2lafw/fx2lafw.c