channels/smartcard: fix some valgrind warnings

This commit is contained in:
Marc-André Moreau 2014-04-09 12:28:03 -04:00
parent 3b1cefd4b2
commit 39f04c870e
3 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -1087,6 +1087,7 @@ void mcs_free(rdpMcs* mcs)
{
if (mcs)
{
free(mcs->channels);
free(mcs);
}
}

View File

@ -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);