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

[libvirt] [PATCH 1/2] coverity: fix memory leak in error path in virnetlink.c



---
 src/util/virnetlink.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index b2e9d51..e199d62 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -340,8 +340,10 @@ virNetlinkEventServiceStart(void)
         goto error;
     }
 
-    if (virMutexInit(&srv->lock) < 0)
+    if (virMutexInit(&srv->lock) < 0) {
+        VIR_FREE(srv);
         goto error;
+    }
 
     virNetlinkEventServerLock(srv);
 
-- 
1.7.7.5


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