mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
don't try to call fclose() if fopen() failed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -827,12 +827,13 @@ struct ast_filestream *ast_readfile(const char *filename, const char *type, cons
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
bfile = fopen(fn, "r");
|
bfile = fopen(fn, "r");
|
||||||
if (!bfile || (fs = get_filestream(f, bfile)) == NULL ||
|
if (!bfile || (fs = get_filestream(f, bfile)) == NULL ||
|
||||||
open_wrapper(fs) ) {
|
open_wrapper(fs) ) {
|
||||||
ast_log(LOG_WARNING, "Unable to open %s\n", fn);
|
ast_log(LOG_WARNING, "Unable to open %s\n", fn);
|
||||||
fclose(bfile);
|
|
||||||
free(fn);
|
|
||||||
if (fs)
|
if (fs)
|
||||||
free(fs);
|
free(fs);
|
||||||
|
if (bfile)
|
||||||
|
fclose(bfile);
|
||||||
|
free(fn);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* found it */
|
/* found it */
|
||||||
|
Reference in New Issue
Block a user