[network-manager-openvpn/nm-1-0] core: mgt_path free mgt_path on disconnect



commit f1c76ec7703659db3a103aa2a1c9b2cc5a864cbe
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Apr 20 17:11:35 2015 +0200

    core: mgt_path free mgt_path on disconnect
    
    We assert it's NULL on connect, triggering an assert fail on reconnect:
    
      (nm-openvpn-service:31948): nm-openvpn-WARNING **: (nm-openvpn-service.c:1194):
          nm_openvpn_start_openvpn_binary: runtime check failed: (priv->mgt_path == NULL)
    
    (cherry picked from commit 31f264a4cc5d3eb33182ea059b6d5365345c819c)

 src/nm-openvpn-service.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 03dbd1e..f362ecb 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1269,7 +1269,6 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
        /* Management socket for localhost access to supply username and password */
        add_openvpn_arg (args, "--management");
        g_warn_if_fail (priv->mgt_path == NULL);
-       g_free (priv->mgt_path);
        priv->mgt_path = g_strdup_printf (LOCALSTATEDIR "/run/NetworkManager/nm-openvpn-%s", uuid);
        add_openvpn_arg (args, priv->mgt_path);
        add_openvpn_arg (args, "unix");
@@ -1682,6 +1681,9 @@ real_disconnect (NMVPNPlugin *plugin,
                priv->pid = 0;
        }
 
+       g_free (priv->mgt_path);
+       priv->mgt_path = NULL;
+
        return TRUE;
 }
 


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