config: be strict on core.commentChar
[gitweb.git] / builtin / mv.c
index 45e57f307b799490a949d60b37f8cff1a1e5d07f..2a7243f52e413c821f9f75969edcc0a9822c8e21 100644 (file)
@@ -162,7 +162,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
                                        if (strncmp(path, src_w_slash, len_w_slash))
                                                break;
                                }
-                               free((char *)src_w_slash);
+                               if (src_w_slash != src)
+                                       free((char *)src_w_slash);
 
                                if (last - first < 1)
                                        bad = _("source directory is empty");