diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2016-09-02 18:22:35 +0200 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2017-04-10 16:48:57 +0900 |
commit | 173b14cafd11a51dc5dbaf5f12ed89fea8ccde7a (patch) | |
tree | 721c7861f1a750f604954e5440faec93b688e9ef /libthor | |
parent | c58876e564a253824bbebf2cea68d3366f641330 (diff) | |
download | lthor-173b14cafd11a51dc5dbaf5f12ed89fea8ccde7a.tar.gz lthor-173b14cafd11a51dc5dbaf5f12ed89fea8ccde7a.tar.bz2 lthor-173b14cafd11a51dc5dbaf5f12ed89fea8ccde7a.zip |
Fix double free on error condition
Change-Id: I41224563de4d6176e60a5f4c893560e3dcf96b86
Reported-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'libthor')
-rw-r--r-- | libthor/thor.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) |