From: Michal MalĂ˝ Date: Tue, 26 Aug 2014 17:55:54 +0000 (+0200) Subject: Don't leak memory in effect manipulation functions. X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=1eaa3e0c272eba13a3892c302f59b7d79346d862;p=KLGD_FF_plugin.git Don't leak memory in effect manipulation functions. --- 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; }