diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-06-06 21:20:11 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-06-06 21:20:11 +0000 |
commit | 9d05ff8ed5f2c898370896ff7a8bb67885596ba1 (patch) | |
tree | 5503cb153c9de46c07e3a0a521cc996926ed375b /res/res_monitor.c | |
parent | 033a3df22aa68f04327066e0567b76f73c437651 (diff) |
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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); } |