projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
935d59f
)
staging: speakup: i18n.c: Fix leak in msg_set()
author
Jesper Juhl
<jj@chaosbits.net>
Tue, 7 Aug 2012 19:44:54 +0000
(21:44 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 14 Aug 2012 02:32:13 +0000
(19:32 -0700)
If we end up returning -EINVAL from the function we will leak the
memory allocated to 'newstr' which has been allocated but not yet
assigned to anything.
Fix the leak by properly freeing the memory again before we return.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/i18n.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/staging/speakup/i18n.c
b/drivers/staging/speakup/i18n.c
index ca01734d13c5f85e7f52ca38aead5ab97ea146fa..7c1658b971dc768958809e347f17b67ba753e428 100644
(file)
--- a/
drivers/staging/speakup/i18n.c
+++ b/
drivers/staging/speakup/i18n.c
@@
-555,6
+555,7
@@
ssize_t msg_set(enum msg_index_t index, char *text, size_t length)
&& index <= MSG_FORMATTED_END)
&& !fmt_validate(speakup_default_msgs[index],
newstr)) {
+ kfree(newstr);
return -EINVAL;
}
spk_lock(flags);