Commit d56495cd authored by Jasper St. Pierre's avatar Jasper St. Pierre
Browse files

idle-monitor: Fix a memory leak when finding the proper IDLETIME counter

https://bugzilla.gnome.org/show_bug.cgi?id=682224
parent 405bfde5
......@@ -181,16 +181,18 @@ find_idletime_counter (Display *display)
int i;
int ncounters;
XSyncSystemCounter *counters;
XSyncCounter counter = None;
counters = XSyncListSystemCounters (display, &ncounters);
for (i = 0; i < ncounters; i++) {
if (counters[i].name != NULL && strcmp (counters[i].name, "IDLETIME") == 0) {
return counters[i].counter;
counter = counters[i].counter;
break;
}
}
XSyncFreeSystemCounterList (counters);
return None;
return counter;
}
static guint32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment