From 91ae636c6fb01c53a9238f65bc1e33ab7e9a810e Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 18 Jul 2018 11:39:55 +0300 Subject: handle asprintf result Change-Id: I4bc290558f5460fa81f31fb9b226239a3deca747 Signed-off-by: George Kiagiadakis --- m4a_afb_comm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/m4a_afb_comm.c b/m4a_afb_comm.c index f4f1ddd..8843255 100644 --- a/m4a_afb_comm.c +++ b/m4a_afb_comm.c @@ -180,7 +180,11 @@ m4a_afb_comm *m4a_afb_comm_new(const char *uri) { m4a_afb_comm *comm; comm = pa_xnew0(m4a_afb_comm, 1); - asprintf(&comm->sessid, "pulseaudio:%d", getpid()); + if (asprintf(&comm->sessid, "pulseaudio:%d", getpid()) < 0) { + pa_log("asprintf failed"); + comm->sessid = NULL; + goto fail; + } if ((ret = sd_event_new(&comm->loop)) < 0) { pa_log("Failed to create systemd event loop: %s", strerror(-ret)); -- cgit 1.2.3-korg