diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-02 23:21:16 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-02 23:42:43 +0100 |
commit | 0d7b9c73197309398c7a36ef03902cc41782a3e9 (patch) | |
tree | 82ece2acde496d4364cbbb820adc5ad4dba65988 | |
parent | api: pass around NET_LUID instead of LUID (diff) | |
download | wintun-0d7b9c73197309398c7a36ef03902cc41782a3e9.tar.xz wintun-0d7b9c73197309398c7a36ef03902cc41782a3e9.zip |
api: free beginning of heap object
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | api/adapter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/api/adapter.c b/api/adapter.c index 5953e9b..1014950 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -282,16 +282,16 @@ DisableAllOurAdapters(_In_ HDEVINFO DevInfo, _Inout_ SP_DEVINFO_DATA_LIST **Disa HeapFree(ModuleHeap, 0, DeviceNode); break; } - goto cleanupDeviceInfoData; + goto cleanupDeviceNode; } BOOL IsOurs; if (IsOurAdapter(DevInfo, &DeviceNode->Data, &IsOurs) != ERROR_SUCCESS || !IsOurs) - goto cleanupDeviceInfoData; + goto cleanupDeviceNode; ULONG Status, ProblemCode; if (CM_Get_DevNode_Status(&Status, &ProblemCode, DeviceNode->Data.DevInst, 0) != CR_SUCCESS || ((Status & DN_HAS_PROBLEM) && ProblemCode == CM_PROB_DISABLED)) - goto cleanupDeviceInfoData; + goto cleanupDeviceNode; LOG(WINTUN_LOG_INFO, L"Force closing all open handles for existing adapter"); if (ForceCloseWintunAdapterHandle(DevInfo, &DeviceNode->Data) != ERROR_SUCCESS) @@ -303,15 +303,15 @@ DisableAllOurAdapters(_In_ HDEVINFO DevInfo, _Inout_ SP_DEVINFO_DATA_LIST **Disa { LOG_LAST_ERROR(L"Failed to disable existing adapter"); Result = Result != ERROR_SUCCESS ? Result : GetLastError(); - goto cleanupDeviceInfoData; + goto cleanupDeviceNode; } DeviceNode->Next = *DisabledAdapters; *DisabledAdapters = DeviceNode; continue; - cleanupDeviceInfoData: - HeapFree(ModuleHeap, 0, &DeviceNode->Data); + cleanupDeviceNode: + HeapFree(ModuleHeap, 0, DeviceNode); } return Result; } |