Browse Source

Call to malloc may return NULL in create_*_error_context(error.c) [msvc /analyze]

master
Reece H. Dunn 9 years ago
parent
commit
6b573e112b
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/libespeak-ng/error.c

+ 4
- 0
src/libespeak-ng/error.c View File

free((*context)->path); free((*context)->path);
} else { } else {
*context = malloc(sizeof(espeak_ng_ERROR_CONTEXT_)); *context = malloc(sizeof(espeak_ng_ERROR_CONTEXT_));
if (!*context)
return ENOMEM;
} }
(*context)->type = ERROR_CONTEXT_FILE; (*context)->type = ERROR_CONTEXT_FILE;
(*context)->path = strdup(filename); (*context)->path = strdup(filename);
free((*context)->path); free((*context)->path);
} else { } else {
*context = malloc(sizeof(espeak_ng_ERROR_CONTEXT_)); *context = malloc(sizeof(espeak_ng_ERROR_CONTEXT_));
if (!*context)
return ENOMEM;
} }
(*context)->type = ERROR_CONTEXT_VERSION; (*context)->type = ERROR_CONTEXT_VERSION;
(*context)->path = strdup(path_home); (*context)->path = strdup(path_home);

Loading…
Cancel
Save