util: fix a memleak printing a tablet tip event

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1165>
This commit is contained in:
Peter Hutterer 2025-03-31 18:08:41 +10:00
parent e77eb469e8
commit be679889e5

View file

@ -469,10 +469,13 @@ print_tablet_tip_event(struct libinput_event *ev, const struct libinput_print_op
char *axes = print_tablet_axes(t);
state = libinput_event_tablet_tool_get_tip_state(t);
return strdup_printf("%s\t%s %s",
time,
axes,
state == LIBINPUT_TABLET_TOOL_TIP_DOWN ? "down" : "up");
char *str = strdup_printf("%s\t%s %s",
time,
axes,
state == LIBINPUT_TABLET_TOOL_TIP_DOWN ? "down" : "up");
free(axes);
return str;
}
static char *