Skip to content

Commit

Permalink
Merge pull request #18 from xiangxistu/master
Browse files Browse the repository at this point in the history
[fix] the error of code.
  • Loading branch information
Guozhanxin committed Nov 15, 2021
2 parents 63afcfe + 654b981 commit bfb0e4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/http_ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static void print_progress(size_t cur_size, size_t total_size)
/* handle function, you can store data and so on */
static int http_ota_shard_download_handle(char *buffer, int length)
{
int ret = RT_EOK;
/* Write the data to the corresponding partition address */
if (fal_partition_write(dl_part, begin_offset, buffer, length) < 0)
{
Expand All @@ -87,9 +88,10 @@ static int http_ota_shard_download_handle(char *buffer, int length)
begin_offset += length;

print_progress(begin_offset, file_size);
rt_free(buffer);

return RT_EOK;
__exit:
rt_free(buffer);
return ret;
}

static int http_ota_fw_download(const char* uri)
Expand Down

0 comments on commit bfb0e4a

Please sign in to comment.