Browse Source

Check the return value of malloc in LoadDataFile(compiledata.c) [msvc /analyze]

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

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

if (*addr > 0) { if (*addr > 0) {
p = ref_hash_tab[hash]; p = ref_hash_tab[hash];
p2 = (REF_HASH_TAB *)malloc(sizeof(REF_HASH_TAB)+strlen(path)+1); p2 = (REF_HASH_TAB *)malloc(sizeof(REF_HASH_TAB)+strlen(path)+1);
if (p2 == NULL)
return ENOMEM;
p2->value = *addr; p2->value = *addr;
p2->ph_mnemonic = phoneme_out->mnemonic; // phoneme which uses this file p2->ph_mnemonic = phoneme_out->mnemonic; // phoneme which uses this file
p2->ph_table = n_phoneme_tabs-1; p2->ph_table = n_phoneme_tabs-1;

Loading…
Cancel
Save