Coverity Report: Fix issues for error type CHECKED_RETURN for core

(issue ASTERISK-19658)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1905/
........

Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2012-05-10 18:35:14 +00:00
parent 3430da58e9
commit 8227f70cd7
14 changed files with 89 additions and 26 deletions

View File

@@ -805,7 +805,9 @@ struct pval *ael2_parse(char *filename, int *errors)
if (my_file)
free(my_file);
my_file = strdup(filename);
stat(filename, &stats);
if (stat(filename, &stats)) {
ast_log(LOG_WARNING, "failed to populate stats from file '%s'\n", filename);
}
buffer = (char*)malloc(stats.st_size+2);
if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
@@ -875,7 +877,9 @@ static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf,
} else {
char *buffer;
struct stat stats;
stat(fnamebuf2, &stats);
if (stat(fnamebuf2, &stats)) {
ast_log(LOG_WARNING, "Failed to populate stats from file '%s'\n", fnamebuf2);
}
buffer = (char*)malloc(stats.st_size+1);
if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));