win-capture: Always set class/title/exe to null

When getting the class/title/exe of a particular window handle in the
build_window_strings function, always set the class/title/exe pointers
to null to prevent any potential references to invalid values if any of
them do not happen to be set for whatever reason.
master
jp9000 2014-11-10 01:18:28 -08:00
parent 87ac9c91bc
commit 7bf69e8a0a
1 changed files with 4 additions and 3 deletions

View File

@ -29,10 +29,11 @@ extern void build_window_strings(const char *str,
{ {
char **strlist; char **strlist;
*class = NULL;
*title = NULL;
*exe = NULL;
if (!str) { if (!str) {
*class = NULL;
*title = NULL;
*exe = NULL;
return; return;
} }