setupapi: Do not cast NULL.

This commit is contained in:
Michael Stefaniuc 2008-11-02 00:21:48 +01:00 committed by Alexandre Julliard
parent 87785a2df0
commit d62b48df2a

View File

@ -342,14 +342,14 @@ StringTableDuplicate(HSTRING_TABLE hStringTable)
if (pSourceTable == NULL) if (pSourceTable == NULL)
{ {
ERR("Invalid hStringTable!\n"); ERR("Invalid hStringTable!\n");
return (HSTRING_TABLE)NULL; return NULL;
} }
pDestinationTable = MyMalloc(sizeof(STRING_TABLE)); pDestinationTable = MyMalloc(sizeof(STRING_TABLE));
if (pDestinationTable == NULL) if (pDestinationTable == NULL)
{ {
ERR("Could not allocate a new string table!\n"); ERR("Could not allocate a new string table!\n");
return (HSTRING_TABLE)NULL; return NULL;
} }
memset(pDestinationTable, 0, sizeof(STRING_TABLE)); memset(pDestinationTable, 0, sizeof(STRING_TABLE));
@ -358,7 +358,7 @@ StringTableDuplicate(HSTRING_TABLE hStringTable)
if (pDestinationTable->pSlots == NULL) if (pDestinationTable->pSlots == NULL)
{ {
MyFree(pDestinationTable); MyFree(pDestinationTable);
return (HSTRING_TABLE)NULL; return NULL;
} }
memset(pDestinationTable->pSlots, 0, sizeof(TABLE_SLOT) * pSourceTable->dwMaxSlots); memset(pDestinationTable->pSlots, 0, sizeof(TABLE_SLOT) * pSourceTable->dwMaxSlots);