This inverts the logic to have a more obvious flow for freeing the
output_info.
==26716== 1,161 bytes in 8 blocks are definitely lost in loss record 5 of 7
==26716== at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==26716== by 0x395D804ABA: XRRGetOutputInfo (in /usr/lib64/libXrandr.so.2.2.0)
==26716== by 0x40932B: map_output_xrandr (transform.c:150)
==26716== by 0x40982F: map_to_output (transform.c:263)
==26716== by 0x4070A4: main (xinput.c:386)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
for (i = 0; i < res->noutput && !found; i++)
{
output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]);
for (i = 0; i < res->noutput && !found; i++)
{
output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]);
- if (!output_info->crtc || output_info->connection != RR_Connected)
- continue;
- if (strcmp(output_info->name, output_name) == 0)
+ if (output_info->crtc && output_info->connection == RR_Connected &&
+ strcmp(output_info->name, output_name) == 0)
+
+ XRRFreeOutputInfo(output_info);
}
/* crtc holds our screen info, need to compare to actual screen size */
}
/* crtc holds our screen info, need to compare to actual screen size */
crtc_info->width, crtc_info->height);
rc = apply_matrix(dpy, deviceid, &m);
XRRFreeCrtcInfo(crtc_info);
crtc_info->width, crtc_info->height);
rc = apply_matrix(dpy, deviceid, &m);
XRRFreeCrtcInfo(crtc_info);
+ XRRFreeOutputInfo(output_info);
} else
printf("Unable to find output '%s'. "
"Output may not be connected.\n", output_name);
} else
printf("Unable to find output '%s'. "
"Output may not be connected.\n", output_name);