From abd0abf01b26c266d391841888a84b95c51babff Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Sun, 16 Nov 2014 23:44:10 +0100 Subject: [PATCH] Fixed allocation size warning. --- channels/cliprdr/client/cliprdr_format.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index 6d3c9fa..3a52a0a 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -127,7 +127,7 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data { UINT32 index; int formatNameLength; - CLIPRDR_FORMAT* formats; + CLIPRDR_FORMAT* formats = NULL; CLIPRDR_FORMAT_LIST formatList; formatList.msgType = CB_FORMAT_LIST; @@ -151,7 +151,8 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data dataLen = formatList.dataLen; Stream_Rewind(s, dataLen); - formats = (CLIPRDR_FORMAT*) calloc(formatList.numFormats, sizeof(CLIPRDR_FORMAT)); + if (formatList.numFormats) + formats = (CLIPRDR_FORMAT*) calloc(formatList.numFormats, sizeof(CLIPRDR_FORMAT)); if (!formats) return; -- 2.7.4