From 1eaa3e0c272eba13a3892c302f59b7d79346d862 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Tue, 26 Aug 2014 19:55:54 +0200 Subject: [PATCH] Don't leak memory in effect manipulation functions. --- klgdff.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/klgdff.c b/klgdff.c index 763355f..836afda 100644 --- a/klgdff.c +++ b/klgdff.c @@ -19,6 +19,7 @@ static struct klgd_command * klgdff_erase(struct input_dev *dev, const struct ff size_t len = strlen(text); struct klgd_command *c = klgd_alloc_cmd(len + 1); memcpy(c->bytes, text, len); + kfree(text); return c; } @@ -28,6 +29,7 @@ static struct klgd_command * klgdff_start(struct input_dev *de, const struct ff_ size_t len = strlen(text); struct klgd_command *c = klgd_alloc_cmd(len + 1); memcpy(c->bytes, text, len); + kfree(text); return c; } @@ -37,6 +39,7 @@ static struct klgd_command * klgdff_stop(struct input_dev *dev, const struct ff_ size_t len = strlen(text); struct klgd_command *c = klgd_alloc_cmd(len + 1); memcpy(c->bytes, text, len); + kfree(text); return c; } @@ -46,6 +49,7 @@ static struct klgd_command * klgdff_upload(struct input_dev *dev, const struct f size_t len = strlen(text); struct klgd_command *c = klgd_alloc_cmd(len + 1); memcpy(c->bytes, text, len); + kfree(text); return c; } -- 2.43.5