mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-14 03:45:42 +01:00
topology: fix possible double free in load()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c9b4293212
commit
88513212c5
1 changed files with 1 additions and 3 deletions
|
@ -100,10 +100,8 @@ static int load(const char *source_file, void **dst, size_t *dst_size)
|
||||||
pos += r;
|
pos += r;
|
||||||
size += 8*1024;
|
size += 8*1024;
|
||||||
buf2 = realloc(buf, size);
|
buf2 = realloc(buf, size);
|
||||||
if (buf2 == NULL) {
|
if (buf2 == NULL)
|
||||||
free(buf);
|
|
||||||
goto _nomem;
|
goto _nomem;
|
||||||
}
|
|
||||||
buf = buf2;
|
buf = buf2;
|
||||||
}
|
}
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
|
Loading…
Reference in a new issue