mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-16 03:10:20 +01:00
tools: record: fix two memory leaks
Found by coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
803519ae59
commit
4ab8a51b68
1 changed files with 4 additions and 1 deletions
|
|
@ -1736,7 +1736,7 @@ print_device_quirks(struct record_context *ctx, struct record_device *dev)
|
|||
struct quirks_context *quirks;
|
||||
const char *data_path = LIBINPUT_QUIRKS_DIR;
|
||||
const char *override_file = LIBINPUT_QUIRKS_OVERRIDE_FILE;
|
||||
const char *builddir = NULL;
|
||||
char *builddir = NULL;
|
||||
|
||||
if (stat(dev->devnode, &st) < 0)
|
||||
return;
|
||||
|
|
@ -1747,6 +1747,8 @@ print_device_quirks(struct record_context *ctx, struct record_device *dev)
|
|||
override_file = NULL;
|
||||
}
|
||||
|
||||
free(builddir);
|
||||
|
||||
quirks = quirks_init_subsystem(data_path,
|
||||
override_file,
|
||||
quirks_log_handler,
|
||||
|
|
@ -1777,6 +1779,7 @@ print_device_quirks(struct record_context *ctx, struct record_device *dev)
|
|||
out:
|
||||
udev_device_unref(udev_device);
|
||||
udev_unref(udev);
|
||||
quirks_context_unref(quirks);
|
||||
}
|
||||
static inline void
|
||||
print_libinput_description(struct record_context *ctx,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue