Skip to content

Commit e3e2ee3

Browse files
authored
Merge pull request #279 from NOVBobLee/fix_memleak
Fix potential memory leak in vinput
2 parents 6771385 + b482911 commit e3e2ee3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/vinput.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,12 @@ static ssize_t export_store(struct class *class, struct class_attribute *attr,
283283
return len;
284284

285285
fail_register_vinput:
286+
input_free_device(vinput->input);
286287
device_unregister(&vinput->dev);
287288
/* avoid calling vinput_destroy_vdevice() twice */
288289
return err;
289290
fail_register:
291+
input_free_device(vinput->input);
290292
vinput_destroy_vdevice(vinput);
291293
fail:
292294
return err;

0 commit comments

Comments
 (0)