From 7f7cbe7f6918418e567c61636d690cc1f87593a5 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Thu, 13 Dec 2007 20:03:20 +0000 Subject: [PATCH] Prevent another potential fd leak git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92807 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_voicemail.c | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index b72d060f9e..cd0aa21f14 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -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);