diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-14 14:24:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-14 14:24:37 -0700 |
commit | 7aab05d2b4114c932f433a8de20707b9c56f8cd3 (patch) | |
tree | 1f375d2d0ceab6fae1c2f50124dbb204f415706f /builtin/mv.c | |
parent | Merge branch 'jk/http-no-curl-easy' (diff) | |
parent | open_istream(): do not dereference NULL in the error case (diff) | |
download | tgif-7aab05d2b4114c932f433a8de20707b9c56f8cd3.tar.xz |
Merge branch 'jk/janitorial-fixes'
* jk/janitorial-fixes:
open_istream(): do not dereference NULL in the error case
builtin/mv: don't use memory after free
utf8: use correct type for values in interval table
utf8: fix iconv error detection
notes-utils: handle boolean notes.rewritemode correctly
Diffstat (limited to 'builtin/mv.c')
-rw-r--r-- | builtin/mv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/mv.c b/builtin/mv.c index 21c46d1636..7e26eb5229 100644 --- a/builtin/mv.c +++ b/builtin/mv.c @@ -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"); |