diff options
-rw-r--r-- | m4a_afb_comm.c | 6 |
1 files changed, 5 insertions, 1 deletions
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)); |