diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2018-07-18 11:39:55 +0300 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2018-08-28 12:14:11 +0300 |
commit | 91ae636c6fb01c53a9238f65bc1e33ab7e9a810e (patch) | |
tree | ba8dc03c1a5aa544d32d2b50e0fbfb08c2734dfb | |
parent | 8e569848ae27b859d8a95b0aadb0c98db6e5dde6 (diff) |
handle asprintf result
Change-Id: I4bc290558f5460fa81f31fb9b226239a3deca747
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
-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)); |