Use xmalloc() and friends to catch allocation failures
[git/git.git] / git.c
diff --git a/git.c b/git.c
index adf7352..905acc2 100644 (file)
--- a/git.c
+++ b/git.c
@@ -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';
                }