diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
commit | eb5d461ed4688cafadc76bebf329a2fae454dc12 (patch) | |
tree | 5503cb153c9de46c07e3a0a521cc996926ed375b /res/res_monitor.c | |
parent | 125558c76fd4870a9133e4974cce6410c89a3593 (diff) |
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_monitor.c')
-rw-r--r-- | res/res_monitor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c index 7b69b6043..5bff1b1ff 100644 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -156,7 +156,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec, if (directory) { char *name = strdup(fname_base); snprintf(tmp, sizeof(tmp), "mkdir -p \"%s\"",dirname(name)); - free(name); + ast_free(name); ast_safe_system(tmp); } snprintf(monitor->read_filename, FILENAME_MAX, "%s/%s-in", @@ -200,7 +200,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec, O_CREAT|O_TRUNC|O_WRONLY, 0, AST_FILE_MODE))) { ast_log(LOG_WARNING, "Could not create file %s\n", monitor->read_filename); - free(monitor); + ast_free(monitor); UNLOCK_IF_NEEDED(chan, need_lock); return -1; } @@ -213,7 +213,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec, ast_log(LOG_WARNING, "Could not create file %s\n", monitor->write_filename); ast_closestream(monitor->read_stream); - free(monitor); + ast_free(monitor); UNLOCK_IF_NEEDED(chan, need_lock); return -1; } @@ -321,8 +321,8 @@ int ast_monitor_stop(struct ast_channel *chan, int need_lock) ast_log(LOG_WARNING, "Execute of %s failed.\n",tmp); } - free(chan->monitor->format); - free(chan->monitor); + ast_free(chan->monitor->format); + ast_free(chan->monitor); chan->monitor = NULL; } @@ -371,7 +371,7 @@ int ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, i if (directory) { char *name = strdup(fname_base); snprintf(tmp, sizeof(tmp), "mkdir -p %s",dirname(name)); - free(name); + ast_free(name); ast_safe_system(tmp); } |