From 39f04c870eebae205f1a89cd4a98f483d2adab1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 9 Apr 2014 12:28:03 -0400 Subject: [PATCH] channels/smartcard: fix some valgrind warnings --- channels/smartcard/client/smartcard_operations.c | 4 ++-- libfreerdp/core/mcs.c | 1 + winpr/libwinpr/smartcard/smartcard_pcsc.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 310963c77..46d01d639 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -152,7 +152,7 @@ size_t smartcard_multi_string_length_a(const char* msz) if (!p) return 0; - while (p[0] || p[1]) + while ((p[0] != 0) && (p[1] != 0)) p++; return (p - msz); @@ -165,7 +165,7 @@ size_t smartcard_multi_string_length_w(const WCHAR* msz) if (!p) return 0; - while (p[0] || p[1]) + while ((p[0] != 0) && (p[1] != 0)) p++; return (p - msz); diff --git a/libfreerdp/core/mcs.c b/libfreerdp/core/mcs.c index efffff5e6..31620b8c8 100644 --- a/libfreerdp/core/mcs.c +++ b/libfreerdp/core/mcs.c @@ -1087,6 +1087,7 @@ void mcs_free(rdpMcs* mcs) { if (mcs) { + free(mcs->channels); free(mcs); } } diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.c b/winpr/libwinpr/smartcard/smartcard_pcsc.c index cc80a31e9..e42dc1875 100644 --- a/winpr/libwinpr/smartcard/smartcard_pcsc.c +++ b/winpr/libwinpr/smartcard/smartcard_pcsc.c @@ -64,7 +64,7 @@ size_t PCSC_MultiStringLengthA(const char* msz) if (!p) return 0; - while (p[0] || p[1]) + while ((p[0] != 0) && (p[1] != 0)) p++; return (p - msz); @@ -77,7 +77,7 @@ size_t PCSC_MultiStringLengthW(const WCHAR* msz) if (!p) return 0; - while (p[0] || p[1]) + while ((p[0] != 0) && (p[1] != 0)) p++; return (p - msz);