[PATCH v2 08/19] modules: Fix resource leak in roap_client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peter Meerwald <p.meerwald@xxxxxxxxxxxxxxxxxx>

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8899&defectInstanceId=3735&mergedDefectId=591272

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/modules/raop/raop_client.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index 98a9822..5bb0bb4 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -367,7 +367,7 @@ static void rtsp_cb(pa_rtsp_client *rtsp, pa_rtsp_state state, pa_headerlist* he
 
 pa_raop_client* pa_raop_client_new(pa_core *core, const char* host) {
     pa_parsed_address a;
-    pa_raop_client* c = pa_xnew0(pa_raop_client, 1);
+    pa_raop_client* c;
 
     pa_assert(core);
     pa_assert(host);
@@ -375,6 +375,7 @@ pa_raop_client* pa_raop_client_new(pa_core *core, const char* host) {
     if (pa_parse_address(host, &a) < 0 || a.type == PA_PARSED_ADDRESS_UNIX)
         return NULL;
 
+    c = pa_xnew0(pa_raop_client, 1);
     c->core = core;
     c->fd = -1;
 
-- 
1.7.9.5



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux