[pulseaudio-discuss] [PATCH 5/8] core: Assert return value of pa_shared_set/_remove() in dbus-shared

Peter Meerwald-Stadler pmeerw at pmeerw.net
Wed Mar 8 15:09:36 UTC 2017


it must succeed, or we are leaking memory

Coverity ID: #1380674, #1380673

Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
---
 src/pulsecore/dbus-shared.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pulsecore/dbus-shared.c b/src/pulsecore/dbus-shared.c
index 935b068..3422c29 100644
--- a/src/pulsecore/dbus-shared.c
+++ b/src/pulsecore/dbus-shared.c
@@ -45,7 +45,7 @@ static pa_dbus_connection* dbus_connection_new(pa_core *c, pa_dbus_wrap_connecti
     pconn->property_name = name;
     pconn->connection = conn;
 
-    pa_shared_set(c, name, pconn);
+    pa_assert_se(pa_shared_set(c, name, pconn) >= 0);
 
     return pconn;
 }
@@ -88,7 +88,7 @@ void pa_dbus_connection_unref(pa_dbus_connection *c) {
 
     pa_dbus_wrap_connection_free(c->connection);
 
-    pa_shared_remove(c->core, c->property_name);
+    pa_assert_se(pa_shared_remove(c->core, c->property_name) >= 0);
     pa_xfree(c);
 }
 
-- 
2.7.4



More information about the pulseaudio-discuss mailing list