config: don't implicitly use gitdir or commondir
[gitweb.git] / connect.c
index 568a35f754e41d54dc0e7133bbfaa0d1d02ccb27..efddb30ea870ee759dc3d1e6e9084a7b6e6ee23c 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -1,5 +1,6 @@
 #include "git-compat-util.h"
 #include "cache.h"
+#include "config.h"
 #include "pkt-line.h"
 #include "quote.h"
 #include "refs.h"
@@ -738,8 +739,10 @@ static void handle_ssh_variant(const char *ssh_command, int is_cmdline,
                         * any longer.
                         */
                        free(ssh_argv);
-               } else
+               } else {
+                       free(p);
                        return;
+               }
        }
 
        if (!strcasecmp(variant, "plink") ||