Skip to content

Commit

Permalink
Fix some code analysis warnings for Packet.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Feb 21, 2018
1 parent 67ab009 commit d6f9fba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packetWin7/Dll/AdInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ static BOOLEAN PacketGetAddressesFromRegistry(LPCSTR AdapterNameA, PNPF_IF_ADDRE
RegCloseKey(UnderTcpKey);
goto fail;
}
RegCloseKey(UnderTcpKey);
}
else
{
Expand All @@ -322,21 +323,18 @@ static BOOLEAN PacketGetAddressesFromRegistry(LPCSTR AdapterNameA, PNPF_IF_ADDRE
status = RegOpenKeyEx(SystemKey,IfNameW,0,KEY_READ,&InterfaceKey);
if (status != ERROR_SUCCESS) {
RegCloseKey(SystemKey);
RegCloseKey(UnderTcpKey);
goto fail;
}
RegCloseKey(SystemKey);
status = RegOpenKeyEx(InterfaceKey,TEXT("Parameters"),0,KEY_READ,&ParametersKey);
if (status != ERROR_SUCCESS) {
RegCloseKey(InterfaceKey);
RegCloseKey(UnderTcpKey);
goto fail;
}
RegCloseKey(InterfaceKey);
status = RegOpenKeyEx(ParametersKey,TEXT("TcpIp"),0,KEY_READ,&TcpIpKey);
if (status != ERROR_SUCCESS) {
RegCloseKey(ParametersKey);
RegCloseKey(UnderTcpKey);
goto fail;
}
RegCloseKey(ParametersKey);
Expand Down
2 changes: 1 addition & 1 deletion packetWin7/Dll/Packet32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ HMODULE LoadLibrarySafe(LPCTSTR lpFileName)
{
res = GetSystemDirectory(path, MAX_PATH);

if (res == 0)
if (res == 0 || !path)
{
//
// some bad failure occurred;
Expand Down

0 comments on commit d6f9fba

Please sign in to comment.