[phodav] unlock: fix a potential leak



commit 76251cec05d1362302058ab2e62c16a4b86d7a20
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Mon Nov 20 14:52:49 2017 +0100

    unlock: fix a potential leak
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 libphodav/phodav-method-unlock.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libphodav/phodav-method-unlock.c b/libphodav/phodav-method-unlock.c
index 17a7c97..c13982a 100644
--- a/libphodav/phodav-method-unlock.c
+++ b/libphodav/phodav-method-unlock.c
@@ -47,11 +47,15 @@ phodav_method_unlock (PathHandler *handler, SoupMessage *msg,
 
   lock = server_path_get_lock (handler_get_server (handler), path, token);
   if (!lock)
-    return SOUP_STATUS_CONFLICT;
+    {
+      status = SOUP_STATUS_CONFLICT;
+      goto end;
+    }
 
   dav_lock_free (lock);
   status = SOUP_STATUS_NO_CONTENT;
 
+end:
   g_free (token);
   return status;
 }


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