OSDN Git Service
(root)
/
android-x86
/
external-alsa-lib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3baf1be
)
control_hw: fix potential memory leak
author
Ivan Sorokin
<vanyacpp@gmail.com>
Tue, 21 Jan 2014 20:12:50 +0000
(
00:12
+0400)
committer
Takashi Iwai
<tiwai@suse.de>
Wed, 22 Jan 2014 06:40:46 +0000
(07:40 +0100)
Signed-off-by: Ivan Sorokin <vanyacpp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/control/control_hw.c
patch
|
blob
|
history
diff --git
a/src/control/control_hw.c
b/src/control/control_hw.c
index
148097f
..
dfc9dcd
100644
(file)
--- a/
src/control/control_hw.c
+++ b/
src/control/control_hw.c
@@
-240,8
+240,10
@@
static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag,
return -errno;
}
if (op_flag == 0) {
- if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size)
+ if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size) {
+ free(xtlv);
return -EFAULT;
+ }
memcpy(tlv, xtlv->tlv, xtlv->tlv[1] + 2 * sizeof(unsigned int));
}
free(xtlv);