]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prevent another potential fd leak
authorMark Michelson <mmichelson@digium.com>
Thu, 13 Dec 2007 20:03:20 +0000 (20:03 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 13 Dec 2007 20:03:20 +0000 (20:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92807 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index b72d060f9ea8b51e6da80c40fb4021bce60ed5ad..cd0aa21f14c96d9a5c4a8ef54f42acaa40407239 100644 (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);