mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-26 13:09:39 +00:00
Call to realloc may leak the manifest data in ReadPhonemeManifest(compiledata.c) [msvc /analyze]
This commit is contained in:
@@ -412,10 +412,13 @@ static espeak_ng_STATUS ReadPhondataManifest(espeak_ng_ERROR_CONTEXT *context)
|
||||
return ENS_EMPTY_PHONEME_MANIFEST;
|
||||
}
|
||||
|
||||
if ((manifest = (NAMETAB *)realloc(manifest, n_lines * sizeof(NAMETAB))) == NULL) {
|
||||
NAMETAB *new_manifest = (NAMETAB *)realloc(manifest, n_lines * sizeof(NAMETAB));
|
||||
if (new_manifest == NULL) {
|
||||
fclose(f);
|
||||
free(manifest);
|
||||
return ENOMEM;
|
||||
}
|
||||
} else
|
||||
manifest = new_manifest;
|
||||
|
||||
n_manifest = 0;
|
||||
while (fgets(buf, sizeof(buf), f) != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user