leak protection, better than mighty putty

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7141 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-01-08 18:35:51 +00:00
parent 4ca4a18f53
commit 9f6f77014f
5 changed files with 93 additions and 66 deletions
+11 -2
View File
@@ -34,8 +34,13 @@
#include <switch.h>
#include "private/switch_core_pvt.h"
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool)
SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file, const char *func, int line,
switch_file_handle_t *fh,
const char *file_path,
uint8_t channels,
uint32_t rate,
unsigned int flags,
switch_memory_pool_t *pool)
{
char *ext;
switch_status_t status;
@@ -63,6 +68,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid file format [%s] for [%s]!\n", ext, file_path);
return SWITCH_STATUS_GENERR;
}
fh->file = file;
fh->func = func;
fh->line = line;
fh->flags = flags;
if (pool) {