aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_oss.c')
-rw-r--r--channels/chan_oss.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 1a6cfd0b6..a4f373ad9 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -1792,12 +1792,15 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg)
if (o->mixer_cmd) {
char *cmd;
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- if (system(cmd) < 0) {
- ast_log(LOG_WARNING, "system() failed: %s\n", strerror(errno));
+ if (asprintf(&cmd, "mixer %s", o->mixer_cmd) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ } else {
+ ast_log(LOG_WARNING, "running [%s]\n", cmd);
+ if (system(cmd) < 0) {
+ ast_log(LOG_WARNING, "system() failed: %s\n", strerror(errno));
+ }
+ free(cmd);
}
- free(cmd);
}
if (o == &oss_default) /* we are done with the default */
return NULL;