Skip to content

Commit 45a76a3

Browse files
authored
DetourAttachEx: set out params to NULL on failure (microsoft#211)
Sets ppRealDetour and ppRealTarget out params to NULL on failure.
1 parent 05623a5 commit 45a76a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/detours.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,12 @@ LONG WINAPI DetourAttachEx(_Inout_ PVOID *ppPointer,
20982098
delete o;
20992099
o = NULL;
21002100
}
2101+
if (ppRealDetour != NULL) {
2102+
*ppRealDetour = NULL;
2103+
}
2104+
if (ppRealTarget != NULL) {
2105+
*ppRealTarget = NULL;
2106+
}
21012107
s_ppPendingError = ppPointer;
21022108
return error;
21032109
}

0 commit comments

Comments
 (0)