mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Convert uses of strdup() to ast_strdup()
(issue #9983, eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -154,7 +154,7 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
|
||||
int directory = strchr(fname_base, '/') ? 1 : 0;
|
||||
/* try creating the directory just in case it doesn't exist */
|
||||
if (directory) {
|
||||
char *name = strdup(fname_base);
|
||||
char *name = ast_strdup(fname_base);
|
||||
snprintf(tmp, sizeof(tmp), "mkdir -p \"%s\"",dirname(name));
|
||||
ast_free(name);
|
||||
ast_safe_system(tmp);
|
||||
@@ -186,9 +186,9 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
|
||||
|
||||
/* Determine file format */
|
||||
if (!ast_strlen_zero(format_spec)) {
|
||||
monitor->format = strdup(format_spec);
|
||||
monitor->format = ast_strdup(format_spec);
|
||||
} else {
|
||||
monitor->format = strdup("wav");
|
||||
monitor->format = ast_strdup("wav");
|
||||
}
|
||||
|
||||
/* open files */
|
||||
@@ -366,7 +366,7 @@ int ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, i
|
||||
int directory = strchr(fname_base, '/') ? 1 : 0;
|
||||
/* try creating the directory just in case it doesn't exist */
|
||||
if (directory) {
|
||||
char *name = strdup(fname_base);
|
||||
char *name = ast_strdup(fname_base);
|
||||
snprintf(tmp, sizeof(tmp), "mkdir -p %s",dirname(name));
|
||||
ast_free(name);
|
||||
ast_safe_system(tmp);
|
||||
|
Reference in New Issue
Block a user