From: Krzysztof Opasiak Date: Fri, 2 Sep 2016 16:22:35 +0000 (+0200) Subject: Fix double free on error condition X-Git-Tag: submit/trunk/20190927.044709~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aed0859ffa05ab75256cba1c1592efc1e61a1b6e;p=tools%2Flthor.git Fix double free on error condition Change-Id: I41224563de4d6176e60a5f4c893560e3dcf96b86 Reported-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Opasiak --- diff --git a/libthor/thor.c b/libthor/thor.c index a670f4d..4ab42a2 100644 --- a/libthor/thor.c +++ b/libthor/thor.c @@ -426,8 +426,11 @@ static int t_thor_send_raw_data(thor_device_handle *th, cancel_chunks: for (j = 0; j < i; ++j) t_thor_cancel_chunk(chunk + j); - if (i) + if (i) { + transfer_data.completed = 0; t_thor_handle_events(&transfer_data); + } + i = ARRAY_SIZE(chunk); cleanup_chunks: for (j = 0; j < i; ++j)