summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-05-13 04:18:25 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-05-13 04:18:25 +0000
commit06882b423283a364fdbea2cac3f675b84cc6a8d3 (patch)
treea89dd0ea675a8e9faa943e0fb3c6f7e3813071be /apps/app_voicemail.c
parent9fd91e0829cb228d687d97a0329f36dd010f63b5 (diff)
Merged revisions 27093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r27093 | tilghman | 2006-05-12 23:08:29 -0500 (Fri, 12 May 2006) | 2 lines Bug 7134 - File descriptor leak with ODBC storage of voicemail ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@27094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index e718853dd..66ccf42ec 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -919,7 +919,7 @@ static int retrieve_file(char *dir, int msgnum)
odbc_release_obj(obj);
goto yuck;
}
- fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC);
+ fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC, 0770);
if (fd < 0) {
ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno));
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
@@ -949,13 +949,13 @@ static int retrieve_file(char *dir, int msgnum)
if (!strcasecmp(coltitle, "recording")) {
res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
fdlen = colsize;
- fd = open(full_fn, O_RDWR | O_TRUNC | O_CREAT, 0770);
if (fd > -1) {
char tmp[1]="";
lseek(fd, fdlen - 1, SEEK_SET);
if (write(fd, tmp, 1) != 1) {
close(fd);
fd = -1;
+ continue;
}
if (fd > -1)
fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);