Skip to content

Commit

Permalink
Merge pull request #279 from NOVBobLee/fix_memleak
Browse files Browse the repository at this point in the history
Fix potential memory leak in vinput
  • Loading branch information
jserv authored Oct 26, 2024
2 parents 6771385 + b482911 commit e3e2ee3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/vinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,12 @@ static ssize_t export_store(struct class *class, struct class_attribute *attr,
return len;

fail_register_vinput:
input_free_device(vinput->input);
device_unregister(&vinput->dev);
/* avoid calling vinput_destroy_vdevice() twice */
return err;
fail_register:
input_free_device(vinput->input);
vinput_destroy_vdevice(vinput);
fail:
return err;
Expand Down

0 comments on commit e3e2ee3

Please sign in to comment.