From 6196eb81b2accb4c25b6b0d5bb583734c6b7040e Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Sun, 16 Nov 2014 16:01:08 +0100 Subject: [PATCH] Fixed free of uninitialized value. --- channels/cliprdr/client/cliprdr_format.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index 239a8ad..bdd100b 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -152,6 +152,9 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data Stream_Rewind(s, dataLen); formats = (CLIPRDR_FORMAT*) malloc(sizeof(CLIPRDR_FORMAT) * formatList.numFormats); + if (!formats) + return; + formatList.formats = formats; while (dataLen) @@ -186,7 +189,10 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data context->ServerFormatList(context, &formatList); for (index = 0; index < formatList.numFormats; index++) - free(formats[index].formatName); + { + if (formats[index].formatName) + free(formats[index].formatName); + } free(formats); } -- 2.7.4