1940. [bug] Fixed a number of error conditions reported by
Coverity.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: t_api.c,v 1.57 2005/06/17 02:22:45 marka Exp $ */
|
||||
/* $Id: t_api.c,v 1.58 2005/11/30 03:33:49 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -542,7 +542,11 @@ t_fgetbs(FILE *fp) {
|
||||
}
|
||||
}
|
||||
*p = '\0';
|
||||
return(((c == EOF) && (n == 0U)) ? NULL : buf);
|
||||
if (c == EOF && n == 0U) {
|
||||
free(buf);
|
||||
return (NULL);
|
||||
}
|
||||
return (buf);
|
||||
} else {
|
||||
fprintf(stderr, "malloc failed %d", errno);
|
||||
return(NULL);
|
||||
@@ -749,8 +753,10 @@ t_eval(const char *filename, int (*func)(char **), int nargs) {
|
||||
/*
|
||||
* Skip comment lines.
|
||||
*/
|
||||
if ((isspace((unsigned char)*p)) || (*p == '#'))
|
||||
if ((isspace((unsigned char)*p)) || (*p == '#')) {
|
||||
(void)free(p);
|
||||
continue;
|
||||
}
|
||||
|
||||
cnt = t_bustline(p, tokens);
|
||||
if (cnt == nargs) {
|
||||
|
||||
Reference in New Issue
Block a user