summaryrefslogtreecommitdiffstats
path: root/alsa-hook/PolicyAlsaHook.c
diff options
context:
space:
mode:
Diffstat (limited to 'alsa-hook/PolicyAlsaHook.c')
-rw-r--r--alsa-hook/PolicyAlsaHook.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/alsa-hook/PolicyAlsaHook.c b/alsa-hook/PolicyAlsaHook.c
index e93edae..62b1a2f 100644
--- a/alsa-hook/PolicyAlsaHook.c
+++ b/alsa-hook/PolicyAlsaHook.c
@@ -275,7 +275,10 @@ static int CallWithTimeout(afbClientT *afbClient, afbRequestT *afbRequest, int c
int err;
// create a unique tag for request
- (void)asprintf(&afbRequest->callIdTag, "%d:%s", count, afbRequest->apiverb);
+ if(asprintf(&afbRequest->callIdTag, "%d:%s", count, afbRequest->apiverb) < 0) {
+ printf("Couldn't allocate request call unique id tag string\n");
+ goto OnErrorExit;
+ }
// create a timer with ~250us accuracy
sd_event_now(afbClient->sdLoop, CLOCK_MONOTONIC, &usec);
@@ -673,10 +676,13 @@ int PLUGIN_ENTRY_POINT (snd_pcm_t *pcm, snd_config_t *conf) {
afbClient->pcm = pcm;
afbClient->name= strdup(snd_pcm_name(pcm));
afbClient->verbose = 0;
- (void) asprintf(&afbClient->uid, "hook:%s:%d", afbClient->name, getpid());
+ if(asprintf(&afbClient->uid, "hook:%s:%d", afbClient->name, getpid()) < 0) {
+ SNDERR("Couldn't allocate client uid string");
+ goto OnErrorExit;
+ }
// Get PCM arguments from asoundrc
- printf("HookEntry handle=0x%x pcm=%s\n", afbClient, afbClient->name);
+ printf("HookEntry handle=0x%p pcm=%s\n", afbClient, afbClient->name);
snd_config_for_each(it, next, conf) {
snd_config_t *node = snd_config_iterator_entry(it);
const char *id;