Prevent another potential fd leak

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2007-12-13 20:03:20 +00:00
parent fb077e33cb
commit 7f7cbe7f69
+1
View File
@@ -2356,6 +2356,7 @@ static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, i
rewind(p);
if((buf = ast_malloc(len+1)) == NIL) {
ast_log(LOG_ERROR, "Can't allocate %ld bytes to read message\n", len+1);
fclose(p);
return -1;
}
fread(buf, len, 1, p);