From 18a994a6bd010c8cc2aaf4ab71cac668456478f3 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Mon, 3 Nov 2008 13:01:18 +0000 Subject: somehow missed a bunch of gcc 4.3.x warnings in this branch on the first pass git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153823 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_oss.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'channels/chan_oss.c') 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; -- cgit v1.2.3