mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-16 04:06:46 +00:00
winex11: Fix memory leak on realloc failure in import_xdnd_selection (cppcheck).
This commit is contained in:
parent
e7ba00c7ca
commit
4aac4e7c67
|
@ -1285,7 +1285,7 @@ struct format_entry *import_xdnd_selection( Display *display, Window win, Atom s
|
|||
UINT i;
|
||||
void *data;
|
||||
struct clipboard_format *format;
|
||||
struct format_entry *ret = NULL, *entry;
|
||||
struct format_entry *ret = NULL, *tmp, *entry;
|
||||
BOOL have_hdrop = FALSE;
|
||||
|
||||
register_x11_formats( targets, count );
|
||||
|
@ -1310,7 +1310,8 @@ struct format_entry *import_xdnd_selection( Display *display, Window win, Atom s
|
|||
entry_size = (FIELD_OFFSET( struct format_entry, data[size] ) + 7) & ~7;
|
||||
if (buf_size < size + entry_size)
|
||||
{
|
||||
if (!(ret = realloc( ret, *ret_size + entry_size + 1024 ))) continue;
|
||||
if (!(tmp = realloc( ret, *ret_size + entry_size + 1024 ))) continue;
|
||||
ret = tmp;
|
||||
buf_size = *ret_size + entry_size + 1024; /* extra space for following entries */
|
||||
}
|
||||
entry = (struct format_entry *)((char *)ret + *ret_size);
|
||||
|
|
Loading…
Reference in a new issue