x11/cliprdr: handle empty format names

The recently added strdup checks ignored the fact that format names
can be NULL.
This commit is contained in:
Bernhard Miklautz 2015-07-02 15:39:35 +02:00
parent 87c5377f42
commit b6a799e5d0
1 changed files with 11 additions and 8 deletions

View File

@ -835,6 +835,8 @@ static int xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_
{
format = &formatList->formats[i];
clipboard->serverFormats[i].formatId = format->formatId;
if (format->formatName)
{
clipboard->serverFormats[i].formatName = _strdup(format->formatName);
if (!clipboard->serverFormats[i].formatName)
{
@ -847,6 +849,7 @@ static int xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_
return -1;
}
}
}
clipboard->numTargets = 2;