diff options
author | Dotan Barak <dotanba@gmail.com> | 2008-09-09 21:57:10 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-09 16:28:05 -0700 |
commit | e8eec71d6e79c176d34dc8fda8780ed4dee447a2 (patch) | |
tree | 67faf2bc865ed17e29ab2ad042a526bc6383a7e3 /git.c | |
parent | 4886b89f8fde57b76738c96761eecbfbd0b13112 (diff) | |
download | git-e8eec71d6e79c176d34dc8fda8780ed4dee447a2.tar.gz |
Use xmalloc() and friends to catch allocation failures
Some places use the standard malloc/strdup without checking if the
allocation was successful; they should use xmalloc/xstrdup that
check the memory allocation result.
Signed-off-by: Dotan Barak <dotanba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -364,7 +364,7 @@ static void handle_internal_command(int argc, const char **argv) if (sizeof(ext) > 1) { i = strlen(argv[0]) - strlen(ext); if (i > 0 && !strcmp(argv[0] + i, ext)) { - char *argv0 = strdup(argv[0]); + char *argv0 = xstrdup(argv[0]); argv[0] = cmd = argv0; argv0[i] = '\0'; } |