[asterisk-commits] anthonyl: branch anthonyl/voicemail-odbc r48457 - /team/anthonyl/voicemail-od...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Dec 13 14:34:11 MST 2006


Author: anthonyl
Date: Wed Dec 13 15:34:10 2006
New Revision: 48457

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48457
Log:
added a small check for a fopen() call

Modified:
    team/anthonyl/voicemail-odbc/apps/app_voicemail.c

Modified: team/anthonyl/voicemail-odbc/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/apps/app_voicemail.c?view=diff&rev=48457&r1=48456&r2=48457
==============================================================================
--- team/anthonyl/voicemail-odbc/apps/app_voicemail.c (original)
+++ team/anthonyl/voicemail-odbc/apps/app_voicemail.c Wed Dec 13 15:34:10 2006
@@ -869,7 +869,12 @@
 		else
 			ast_copy_string(fn, dir, sizeof(fn));
 		snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
-		f = fopen(full_fn, "w+");
+		
+		if (!(f = fopen(full_fn, "w+")) {
+		        ast_log(LOG_WARNING, "Failed to open/create '%s'\n", full_fn);
+		        goto yuck;
+		}
+		
 		snprintf(full_fn, sizeof(full_fn), "%s.%s", fn, fmt);
 		res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {



More information about the asterisk-commits mailing list