mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
fix memory leak in do_convert() in src/libcdio/driver/utf8.c
This commit is contained in:
parent
92d046e663
commit
db649b963c
1 changed files with 4 additions and 0 deletions
|
@ -206,16 +206,20 @@ do_convert(iconv_t cd, const char * src, int src_len,
|
|||
{
|
||||
switch(errno)
|
||||
{
|
||||
char * ret_tmp;
|
||||
|
||||
case E2BIG:
|
||||
output_pos = (int)(outbuf - ret);
|
||||
|
||||
alloc_size += BYTES_INCREMENT;
|
||||
outbytesleft += BYTES_INCREMENT;
|
||||
|
||||
ret_tmp = ret;
|
||||
ret = realloc(ret, alloc_size);
|
||||
if (ret == NULL)
|
||||
{
|
||||
cdio_warn("Can't realloc(%d).", alloc_size);
|
||||
free(ret_tmp);
|
||||
return false;
|
||||
}
|
||||
outbuf = ret + output_pos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue