Browse Source

Call to realloc may leak the manifest data in ReadPhonemeManifest(compiledata.c) [msvc /analyze]

master
Reece H. Dunn 9 years ago
parent
commit
242cb51c38
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/libespeak-ng/compiledata.c

+ 5
- 2
src/libespeak-ng/compiledata.c View File

return ENS_EMPTY_PHONEME_MANIFEST; 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); fclose(f);
free(manifest);
return ENOMEM; return ENOMEM;
}
} else
manifest = new_manifest;


n_manifest = 0; n_manifest = 0;
while (fgets(buf, sizeof(buf), f) != NULL) { while (fgets(buf, sizeof(buf), f) != NULL) {

Loading…
Cancel
Save