gitweb: Protect against possible warning in git_commitdiff
[gitweb.git] / builtin-rm.c
index 593d86744c41a1f28258b3adb6e6cd556a64b61f..33d04bd015e43965a1bc44bb281908298f152f6c 100644 (file)
@@ -32,7 +32,7 @@ static int remove_file(const char *name)
 
        ret = unlink(name);
        if (!ret && (slash = strrchr(name, '/'))) {
-               char *n = strdup(name);
+               char *n = xstrdup(name);
                do {
                        n[slash - name] = 0;
                        name = n;