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

@@ -38,6 +38,8 @@ espeak_ng_STATUS create_file_error_context(espeak_ng_ERROR_CONTEXT *context, esp
free((*context)->path);
} else {
*context = malloc(sizeof(espeak_ng_ERROR_CONTEXT_));
if (!*context)
return ENOMEM;
}
(*context)->type = ERROR_CONTEXT_FILE;
(*context)->path = strdup(filename);
@@ -54,6 +56,8 @@ espeak_ng_STATUS create_version_mismatch_error_context(espeak_ng_ERROR_CONTEXT *
free((*context)->path);
} else {
*context = malloc(sizeof(espeak_ng_ERROR_CONTEXT_));
if (!*context)
return ENOMEM;
}
(*context)->type = ERROR_CONTEXT_VERSION;
(*context)->path = strdup(path_home);

Loading…
Cancel
Save